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

相关推荐
Lsetea11 小时前
部署证书后提示“证书名称与输入不匹配”:Safari 报错的三层排查
nginx·https·safari·ssl证书·openssl
打工仔折腾 AI1 天前
FastAPI 从本机到生产服务器:Nginx+Gunicorn+Uvicorn 完整部署实录
人工智能·后端·python·nginx·fastapi·gunicorn
Linux运维技术栈1 天前
如何避免绕过CDN的攻击?基于 CDN 回源请求头鉴权的防御实操与安全性剖析
nginx·安全·cdn
Lsetea1 天前
OpenSSL快速生成域名证书:含SAN的自签命令、验证与排错
nginx·https·ssl证书·openssl·自签证书
小小的木头人2 天前
CentOS 7 下 Nginx 访问自定义目录报 403 的完整排查:从端口权限到 SELinux
nginx·centos
新时代农民工~2 天前
【双机高可用部署方案-前后端部署】
java·nginx·springboot
运维全栈笔记2 天前
Nginx 模块化多业务站点通用配置模板
linux·运维·nginx
蓝胖的四次元口袋3 天前
Docker Compose多容器编排与Nginx集群实战
运维·nginx·docker compose
师傅别念了3 天前
Nginx 反向代理配置指南,看完这篇就够了
nginx
java资料站4 天前
NextScan(飞刃)v1.2.0 docker-compose 部署解析
漏洞