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!