Reputation: 1543
I have a website works with nginx. I want to hide the nginx name in http headers, is there any way to hide nginx name without uninstalling and reinstalling ??
Upvotes: 0
Views: 5086
Reputation: 11
easy to delete follow this process
yum install nginx-module-headers-more;
vi /etc/nginx/nginx.conf
load_module modules/ngx_http_headers_more_filter_module.so;
server_tokens off;
fastcgi_hide_header X-Powered-By;
more_clear_headers Server;
systemctl restart nginx
Upvotes: 1
Reputation: 146630
You can change it or disable using below
Change It
server_tokens "off";
more_set_headers "Server: Your_New_Server_Name";
or
Delete it
server_tokens "off";
more_clear_headers "Server";
PS: Above requires the module https://www.nginx.com/resources/wiki/modules/headers_more/
On the commercial version you can just do
server_tokens "";
And this will disable the server tokens
Upvotes: 0