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

相关推荐
郝亚军5 小时前
使用Vue 3和Nginx打包和部署Vue.js项目的一般步骤
前端·vue.js·nginx
難釋懷13 小时前
Nginx代理https请求
redis·nginx·https
chexus2 天前
21. 深入 Nginx HTTP 缓存源码:CDN功能
nginx·http·缓存
BelongPanda2 天前
Linux Nginx 纯手动 Let‘s Encrypt 泛域名证书配置教程
linux·nginx
郝亚军3 天前
nginx的三个基础库:PCRE、OpenSSL、Zlib的安装
linux·服务器·nginx
CodexDave3 天前
MySQL事务隔离级别与MVCC机制解析
前端·数据库·mysql·nginx·性能优化·负载均衡
chexus4 天前
20. 深入 Nginx 信号处理
linux·c语言·网络·nginx
名字还没想好☜4 天前
Nginx 反向代理与负载均衡配置实战
运维·nginx·负载均衡
菩提小狗4 天前
每日安全情报报告 · 2026-07-19
网络安全·漏洞·cve·安全情报·每日安全