msln
msln

Reputation: 1543

How to hide NGINX name in an installed instance

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

Answers (2)

Narayan khadka
Narayan khadka

Reputation: 11

easy to delete follow this process

install

yum install nginx-module-headers-more;

vi /etc/nginx/nginx.conf

add_php version_server_nginx hide narayan

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

Tarun Lalwani
Tarun Lalwani

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

Related Questions