【安全漏洞-中间件】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即可。

相关推荐
Ghost Face...4 分钟前
PCI总线配置核心实现与架构解析
linux·运维·架构
成为你的宁宁4 分钟前
【Prometheus监控Nginx/Mysql/Redis/Docker/Rabbitmq】
mysql·nginx·prometheus
阿里-于怀12 分钟前
告别 Ingress Nginx:云原生 API 网关 Gateway API 使用指引
nginx·云原生·gateway
難釋懷21 分钟前
Nginx应用场景
运维·nginx
曾阿伦24 分钟前
Linux 系统资源查看命令大全
linux·运维·服务器
qq_4017004126 分钟前
TCP 多客户端与服务器通信程序
运维·服务器
宠..26 分钟前
VS Code SSH 远程连接 Ubuntu 并实现快速运行(C/C++示例)
java·运维·c语言·开发语言·c++·ubuntu·ssh
量子罐头27 分钟前
国产鲲鹏服务器适配:光润通 100GbE 网卡性能实测报告
运维·服务器
WPF工业上位机27 分钟前
匠心研智造-上位机硬件通讯之Modbus 服务器
运维·服务器
Harm灬小海27 分钟前
【云计算学习之路】学习Centos7系统:Linux进程管理
linux·运维·服务器·学习·云计算