为什么要隐藏 Nginx 版本号:一般来说,软件的漏洞都与版本有关,隐藏版本号是为了防止恶意用户利用软件漏洞进行攻击
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server_tokens off; # 隐藏版本号
server {
listen 80;
server_name www.abc.com;
location / {
root html/www;
index index.html index.htm;
}
}
检查语法是否正确 nginx -t
重新加载nginx systemctl restart nginx
检查版本号是否已经能隐藏
curl -I 127.0.0.1
本文暂时没有评论,来添加一个吧(●'◡'●)