“可通过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/

相关推荐
星光不问赶路人13 小时前
Nginx 的 location 路径匹配语法详解
nginx·api
GDAL13 小时前
深入理解 NJS 全局对象:掌控运行时的核心工具
nginx·njs
GDAL15 小时前
精通 NJS HTTP 请求对象:全方位掌控 NGINX 请求生命周期
nginx·njs
飞翔沫沫情15 小时前
Nginx运维维护规范及全配置详解【持续更新】
nginx·nginx 配置·nginx 操作手册·nginx 使用规范·nginx 日志规范·nginx 配置文件说明
deriva16 小时前
nginx如何将某域名/二级站点/代理到二级站点?以ChirpStack实战为例
运维·nginx
睡不醒的猪儿1 天前
nginx常见的优化配置
运维·nginx
root666/1 天前
【后端开发-nginx】proxy_pass和proxy_redirect参数作用
运维·nginx
工具罗某人2 天前
docker快速部署kafka
java·nginx·docker
864记忆2 天前
Qt创建连接注意事项
数据库·qt·nginx
Anarkh_Lee2 天前
别再手写 conf 了!NgxFlow:基于 React Flow 的 Nginx 可视化与调试神器
前端·nginx·数据可视化