打开conf/nginx.conf文件

找到http{ }段落,在其中加入server_tokens off;配置,然后重启nginx就可以隐藏版本号了