adminuser@ubuntu:/usr/local/nginx/nginx/sbin$ curl -I 192.168.1.230
HTTP/1.1 200 OK
Server: openresty/1.7.0.1
Date: Wed, 20 Jan 2016 01:34:05 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Fri, 15 Jan 2016 03:50:32 GMT
Connection: keep-alive
ETag: “56986c88-264”
Accept-Ranges: bytes

隐藏版本号:

adminuser@ubuntu:/usr/local/nginx/nginx/conf$ sudo vim nginx.conf

http
{
server_tokens off; 新增这个隐藏版本号
}

更改后reload之后,测试:

adminuser@ubuntu:/usr/local/nginx/nginx/sbin$ curl -I 192.168.1.230
HTTP/1.1 200 OK
Server: openresty
Date: Wed, 20 Jan 2016 01:44:02 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Fri, 15 Jan 2016 03:50:32 GMT
Connection: keep-alive
ETag: “56986c88-264”
Accept-Ranges: bytes

Comments

2016-01-23