问题如下
解决办法
nginx/conf/nginx.conf
http { ... server_tokens off ... }
实现方案:需要重新编译nginx
进入解压出来的nginx
源码目录(不是nginx的安装目录)
vim src/http/ngx_http_header_filter_module.c # 49-50行
内容
static char ngx_http_server_string[] = "Server: nginx" CRLF;static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
更改为
static char ngx_http_server_string[] = "Server: Web" CRLF;static char ngx_http_server_full_string[] = "Server:Web " CRLF;
修改完后重新编译nginx,再看header里面Server信息变成了自定义的信息,不再显示nginx
信息了。