通过在配置文件的http节配置server_tokens off来达到我们目的。
server_tokens off;
abcdeMacBook-Air:plexus-utils abc$ curl -I http://123.123.123.123/greeting
HTTP/1.1 200
Server: nginx -- 已经没有版本号了
Date: Thu, 09 Nov 2017 01:45:47 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 35
Connection: keep-alive
X-ReqId: 63ce6a6cabb9dcc03d5ddae6cb2b61d7