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 –

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 any other answers on Server Fault.

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