nginx的Web 服务器 HTTP 头文件信息披露解决方案

漏洞描述:

调整前:

1. 从安装包开始:

解压:

tar -xvf nginx-1.19.2.tar.gz

重命名:

mv nginx-1.19.2 nginx

 

cd nginx

隐藏server信息

vim src/http/ngx_http_header_filter_module.c

第49行

2. 进入nginx的配置文件目录:

cd  /usr/local/nginx/conf

3. 修改配置文件

vim nginx.conf

增加server_tokens off;

4. 重启

service nginx restart

效果展示: