So is there any way to hide X-Powered-By on Nginx?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
x-powered-by is given by the module, for instance php fastcgi module offers to set expose_php=Off
in php.ini
回答2:
proxy_hide_header X-Powered-By;
回答3:
fastcgi_hide_header X-Powered-By
or proxy_hide_header X-Powered-By
on http/server context
回答4:
If you use NGINX with FastCGI you should use:
fastcgi_hide_header X-Powered-By;
回答5:
Try to use the more_clear_headers directive from the nginx's HttpHeadersMoreModule which can allow you to declare:
more_clear_headers 'X-Powered-By';
which should do just what you want.
回答6:
#nano /etc/nginx/nginx.conf
comment this line
more_clear_headers 'X-Powered-By';
and restart Nginx