How to change NGINX server name

Kimi asked:

In the Apache web server we can change the server signature (Apache Name) using mod_rewrite.

For example – http://www.howtoforge.com/changing-apache-server-name-to-whatever-you-want-with-mod_security-on-debian-6

How would I do the same with Nginx? I am new to Nginx and want to replace the Nginx name with my own signature.

I am using Ubuntu 12.04 Server Edition.

My answer:


For nginx, you will need to compile in the headers more module (it is not included with nginx by default). This will allow you to override the Server: header.

After that, you can simply do:

more_set_headers "Server: my_phone/1.0"

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.