隐藏nginx的版本号

vim /usr/local/nginx/conf/nginx.conf
在http作用域加上server_tokens off;

http {
#...
	server_tokens off;
#...
}

vim /usr/local/nginx/conf/fcgi.conf
把/$nginx_version去掉

#fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
fastcgi_param  SERVER_SOFTWARE    nginx;

然后重载nginx
/usr/local/nginx/sbin/nginx -s reload