标签:nginx基础 安全 NGINX优化 nginx 逗哥自动化
Nginx基础安全 [root@web02 ~]# vim /application/nginx/conf/nginx.conf
http{
server_tokens off;
}
#我们在http标签端开启即可
没修改之前
[root@localhost home]# curl -I www.etiantian.org
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Fri, 16 Mar 2018 09:29:17 GMT
Content-Type: text/html
Content-Length: 2781
Last-Modified: Tue, 13 Mar 2018 08:21:13 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "5aa789f9-add"
Accept-Ranges: byte
修改后结果(需要重启生效)
[root@localhost home]# curl -I www.etiantian.org
HTTP/1.1 200 OK
Server: nginx ##版本号消失
Date: Fri, 16 Mar 2018 09:26:19 GMT
Content-Type: text/html
Content-Length: 2781
Last-Modified: Tue, 13 Mar 2018 08:21:13 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "5aa789f9-add"
Accept-Ranges: bytes
修改为后浏览器访问404界面也不会出现版本信息
标签:nginx基础 安全 NGINX优化 nginx 逗哥自动化
原文地址:http://blog.51cto.com/qiuyt/2087714