Hide X-Powered-By (nginx)

2019-02-01 18:30发布

问题:

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