JAVA和Nginx 教程大全

网站首页 > 精选教程 正文

nginx 隐藏nginx版本号

wys521 2024-09-12 23:15:09 精选教程 34 ℃ 0 评论

为什么要隐藏 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

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表