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

Source: Internet
Author: User

How to modify the Nginx default name, you can disguise a little bit, you can also install X

Generally modified 3 positions, one is nginx.h, the other is ngx_http_header_filter_module.c, there is a ngx_http_special_response.c.

Tip: General changes are modified before Nginx compile, after modification, you need to recompile

Copy Code code as follows:

Scr/core/nginx.conf
#define Nginx_version "1.4.7"
#define Nginx_ver "nginx/" nginx_version

Modified to: (In fact, the version number can also be arbitrarily modified)

Copy Code code as follows:

#define Nginx_version "1.4.7"
#define Nginx_ver "jdws/" nginx_version

Actually, most of the above changes will take effect!!!

Copy Code code as follows:

/SRC/HTTP/NGX_HTTP_HEADER_FILTER_MODULE.C (http Responseheader)
static char ngx_http_server_string[] = "Server:nginx" CRLF;

Modified to:

Copy Code code as follows:

static char ngx_http_server_string[] = "Server:jdws" CRLF;
/src/http/ngx_http_special_response.c
Static U_char ngx_http_error_tail[] =
""</body>" CRLF
"

Modified to:

Copy Code code as follows:

Static U_char ngx_http_error_tail[] =
""</body>" CRLF
"

In addition to arbitrarily modifying the version number, you can also hide the version number:

Modify Nginx.conf

Join in http{}

Copy Code code as follows:

http{
Server_tokens off;
}

You can hide the version number.

Attention:

After you turn off the Server_tokens, the nginx.conf configuration will not work, go back and look for the second and third steps of our configuration

Version number not hidden:

Hide Version Number:

The above is a small set to introduce how to modify the name of the Nginx version of any Web server, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.