Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to modify the Nginx version name to disguise any web server

Shulou Source: shulou.com Published: 2022-05-31 12:22:59 09月14日 Update

This article mainly introduces how to modify the Nginx version name camouflage any web server related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this how to modify the Nginx version name camouflage any web server article will have a harvest, let's take a look.

How to change the default name of nginx can be camouflaged slightly or x

Generally speaking, you can modify three locations, one is nginx.h, the other is ngx_http_header_filter_module.c, and one is ngx_http_special_response.c.

Tip: generally, changes are made before nginx compilation, and need to be recompiled after modification.

The code is as follows:

Scr/core/nginx.conf

# define nginx_version "1.4.7"

# define nginx_ver "nginx/" nginx_version

Change it to: (in fact, the version number can also be changed at will)

The code is as follows:

# define nginx_version "1.4.7"

# define nginx_ver "jdws/" nginx_version

In fact, most of the above changes will take effect!

The code is as follows:

/ src/http/ngx_http_header_filter_module.c (http responseheader)

Static char ngx_http_server_string [] = "server: nginx" crlf

Modified to:

Static char ngx_http_server_string [] = "server: jdws" crlf

/ src/http/ngx_http_special_response.c

Static u_char ngx_http_error_tail [] =

"nginx" crlf

"" crlf

"" crlf

Modified to:

Static u_char ngx_http_error_tail [] =

"jdws" crlf

"" crlf

"" crlf

In addition to changing the version number at will, you can also hide the version number:

Modify nginx.conf

Join in http {}

The code is as follows:

Http {

Server_tokens off

}

You can hide the version number.

Note:

After turning off server_tokens, the configuration of nginx.conf will be invalid. Go back to the configuration we just did in steps 2 and 3.

Unhidden version number:

Hidden version number:

This is the end of the article on "how to modify the name of the Nginx version to disguise any web server". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to modify the name of the Nginx version to disguise any web server". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Version name code knowledge content article compilation configuration generally speaking thing bit value most finished easy to operate article easy to understand is in more see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno macOS vpn Linux