nginx-- website display problems

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

Tip: Generally are modified before compiling nginx modify, amend after the expiry of the need to recompile 
cd the SCR /core/nginx.conf

#define NGINX_VERSION      "1.4.7"
#define NGINX_VER          "nginx/" NGINX_VERSION
Changed
#define NGINX_VERSION      "1.4.7"
#define NGINX_VER          "jdws/" NGINX_VERSION

cd /src/http/ngx_http_header_filter_module.c (HTTP ResponseHeader)
static char ngx_http_server_string[] = "Server: nginx" CRLF;
change into
static char ngx_http_server_string[] = "Server: jdws" CRLF;

vim /src/http/ngx_http_special_response.c 
static u_char ngx_http_error_tail[] =
"<hr><center>nginx</center>" CRLF
"</body>" CRLF
"</html>" CRLF
change into

static u_char ngx_http_error_tail[] =
"<hr><center>jdws</center>" CRLF
"</body>" CRLF
"</html>" CRLF

In addition to freely modify the version number, you can also hide the version number:

Modify nginx.conf

Was added at http {}

http{
     server_tokens  off;  
}
It can hide the version number.
note:

After turn off the server_tokens, something nginx.conf configuration will be invalid, go back and look for just configure our second and third steps of

 

Guess you like

Origin www.cnblogs.com/betterquan/p/11832799.html