“可通过HTTP获取远端WWW服务信息”漏洞修复

环境说明:①操作系统:windows server;②nginx:1.27.1。

1.漏洞说明

"可通过HTTP获取远端WWW服务信息"。

修复前,在"响应标头"能看到Server信息,如下图所示:

修复后,"响应标头"已移除Server信息,如下图所示:

2. 网上解决方案

①方法1:Nginx添加扩展headers-more-nginx-module。这种方法需要下载扩展模块,重新编译、安装,比较麻烦。

②方法2:直接使用Openresty替换Nginx。OpenResty已经集成了headers-more-nginx-module模块。且使用上跟直接使用nginx一样。

3.替换nginx

3.1 替换配置文件

替换过程比较简单,把原来的nginx.conf文件拷贝到OpenResty对应位置。重新启动OpenResty即可。

3.2 修改配置

  • openresty的nginx.conf配置中,关于文件夹路径改用绝对路径,否则报500错误。

  • openresty的nginx.conf配置文件中的http节点下添加more_clear_headers 'Server';

xml 复制代码
more_clear_headers 'Server'

4.OpenResty介绍

OpenResty® is a full-fledged web platform that integrates our enhanced version of the Nginx core, our enhanced version of LuaJIT, many carefully written Lua libraries, lots of high quality 3rd-party Nginx modules, and most of their external dependencies. It is designed to help developers easily build scalable web applications, web services, and dynamic web gateways.

详见官网:https://openresty.org/en/

相关推荐
ping某1 天前
为什么 Nginx 明明监听了 80,转发后端时却用了 4xxxx 端口?
后端·nginx
難釋懷3 天前
Nginx反向代理中的容错机制
运维·nginx
bloglin999993 天前
Nginx高危漏洞CVE-2021-23017及配置样例
运维·nginx
进阶的小名3 天前
Spring Boot SSE + Nginx 配置:解决 EventSource 不实时返回、连接超时、流式响应被缓冲问题
spring boot·后端·nginx
難釋懷4 天前
Nginx获取客户端真实IP
服务器·前端·nginx
qq_谁赞成_谁反对4 天前
甲方IT的成长之路--nginx实战--2604
服务器·数据库·nginx
图灵追慕者4 天前
Nginx安裝以及配置顯示本地服務器文件夾
运维·nginx
rabbit_pro4 天前
Nginx配置维护模式
运维·nginx
楠目4 天前
Nginx 解析漏洞利用总结
nginx·网络安全
Coisinier4 天前
RHCE中shell脚本基础(磁盘剩余空间监控,Web 服务状态检查,curl 访问 Web 服务并返回状态)
linux·运维·服务器·前端·nginx·操作系统