Hide X-Powered-by (Nginx)
So Is There Any Way to Hide X-Powered-by on Nginx? 4 7 Answers Proxy_Hide_Header X-Powered-By; 5 X-Powered-by Is Given by the Module, for Instance Php Fastcgi...
So is there any way to hide X-Powered-By on Nginx?
7 Answers
proxy_hide_header X-Powered-By;
x-powered-by is given by the module, for instance php fastcgi module offers to set expose_php=Off
in php.ini
fastcgi_hide_header X-Powered-By or proxy_hide_header X-Powered-By on http/server context
If you use NGINX with FastCGI you should use:
fastcgi_hide_header X-Powered-By;
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.
Must Read
Nginx
Open this file
$
sudo vi /etc/nginx/nginx.confFind the HTTP section, this section defines configurations for Nginx's HttpCoreModule. Add the below directive:
$
server_tokens off;
This will configure Nginx not send any version numbers in the HTTP header.
(Removing the server name is possible, however, since Nginx modules cannot be dynamically loaded, you would need to recompile Nginx from source with the HttpHeadersMoreModule Nginx module.)
Reload Nginx configuration To apply the change, reload Nginx service:
$
sudo service nginx reload