参考如下配置
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即可。