How to change(Hide) the Nginx Server Signature? How to change(Hide) the Nginx Server Signature? nginx nginx

How to change(Hide) the Nginx Server Signature?


If you are working in ubuntu then

  1. First install nginx-extras

    sudo apt-get install nginx-extras
  2. Go to /etc/nginx/nginx.conf and under http add:

    http {    more_set_headers "Server: Your_New_Server_Name";    server_tokens off; }
  3. Restart nginx

    sudo service nginx restart


  1. Install HttpHeadersMoreModule - http://wiki.nginx.org/HttpHeadersMoreModule
  2. Change it using the more_set_headers directive.
  3. Reload Nginx to take effect.

    Hide nginx version information.

    server_tokens off;

    Change the server name.

    more_set_headers "Server: MyServerName";


Go to nginx conf and switch off server_tokens.

/etc/nginx/nginx.confserver_tokens off;