vi /etc/nginx/nginx.conf
# 在 http{} 中加入 server_tokens off,隐藏Nginx版本;

nginxhidever.png

vi /etc/php.ini
# 将 expose_php = On; 改为 expose_php = Off,隐藏PHP版本;

phphidever.png

systemctl restart nginx
systemctl restart php
# 重启Nginx与PHP使配置生效

curl -I 127.0.0.1
# 查看效果

httpheader.png

标签: none

添加新评论