Modified HTTP response header information NGINX real SERVER

If you need a custom Server information below:

 Nginx need to change the source code and recompile the installation, need to change the source code module information is as follows:

// 文件1.src/http/ngx_http_header_filter_module.c

static u_char ngx_http_server_string[] = "Server: nginx" CRLF;
static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;

// File 2 (optional) .src / core / nginx.h some variables and configuration version information:

 If the version number just want to hide, adding server_tokens off in the configuration file in nginx.conf http category;

Guess you like

Origin www.cnblogs.com/qiutianjia/p/11573326.html