【安全漏洞-中间件】nginx版本号屏蔽

参考如下配置

server_tokens off;

1.找到nginx配置文件 nginx.conf

2.在http区段插入 server_tokens off;

复制代码
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  2048;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

	server_tokens off;
	
    sendfile        on;
    keepalive_timeout  65;
    client_max_body_size 50m;


    server {
        listen       80;
        server_name  localhost;
		server_tokens off;

	
		location / {


        }

}

3.重启nginx即可。

相关推荐
Elastic 中国社区官方博客3 小时前
使用 Elastic Cloud Serverless 扩展批量索引
大数据·运维·数据库·elasticsearch·搜索引擎·云原生·serverless
超龄超能程序猿4 小时前
Docker GPU插件(NVIDIA Container Toolkit)安装
运维·docker·容器
岁岁种桃花儿4 小时前
Nginx 站点垂直扩容(单机性能升级)全攻略
网络·nginx·dns
2501_906150565 小时前
私有部署问卷系统操作实战记录-DWSurvey
java·运维·服务器·spring·开源
岳来5 小时前
docker 从 Path 值看容器启动命令
运维·docker·容器
RisunJan6 小时前
Linux命令-ifconfig命令(配置和显示网络接口的信息)
linux·运维·服务器
杭州泽沃电子科技有限公司6 小时前
面对风霜雨雪雷电:看在线监测如何为架空线路筑牢安全网
运维·人工智能·在线监测·智能监测
lbb 小魔仙6 小时前
【Linux】100 天 Linux 入门:从命令行到 Shell 脚本,告别“光标恐惧”
linux·运维·服务器
早川9197 小时前
Linux系统
linux·运维·服务器
iFlow_AI8 小时前
iFlow CLI + ACK MCP Server:让 ACK 容器运维进入对话时代
运维·ack·iflow·iflow cli