security - nginx隐藏服务器信息




隐藏X-Powered-By(nginx) (4)

那么有没有办法在Nginx上隐藏X-Powered-By?


x-powered-by由模块给出,例如php fastcgi模块提供在php.ini中设置expose_php=Off




#nano /etc/nginx/nginx.conf

评论这一行

more_clear_headers 'X-Powered-By';

并重新启动Nginx





nginx