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

相关推荐
踩踩芽11 小时前
【苍穹外卖】修改前端代码解决修改Nginx端口后websocket连接失败的问题
websocket·nginx·苍穹外卖
carfied-feifei14 小时前
基于 Nginx 的 CDN 基础实现
nginx·cloud native
ekskef_sef1 天前
用nginx正向代理https网站
运维·nginx·https
Future_yzx2 天前
Linux系统安装Nginx详解(适用于CentOS 7)
linux·nginx·centos
大厂在职_few2 天前
Nginx&Web负载均衡集群搭建
前端·nginx·负载均衡
m0_748239472 天前
重启 nginx
java·前端·nginx
brhhh_sehe2 天前
Nginx与frp结合实现局域网和公网的双重https服务
数据库·nginx·https
m0_748245522 天前
macOs安装docker且在docker上部署nginx+php
nginx·macos·docker
windfbi2 天前
【Nginx + Keepalived 实现高可用的负载均衡架构】
nginx·架构·负载均衡