0

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.

0

2 Answers 2

2

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"
1
  • thanks for the reply. which file i've to edit? can you put here commands? I'm totally Newbie for NGINX :(
    – Kimi
    Sep 6, 2013 at 15:48
0

A. http://wiki.nginx.org/NginxHttpHeadersMoreModule#more_set_headers

B. Edit source code and replace ngx_http_server_string value

C. [Beta] Use modsecurity

D. [not recommended] Use reverse-proxy like Varnish or Squid to hide header (headers will be resolvable when accessing localhost)

5
  • thanks for the reply. which file I've to edit?
    – Kimi
    Sep 6, 2013 at 15:45
  • hg.nginx.org/nginx/file/b95e70ae6bcd/src/http/… line 49
    – GioMac
    Sep 6, 2013 at 15:48
  • note, it's still possible to recognize, that it's not IIS
    – GioMac
    Sep 6, 2013 at 15:49
  • thanks for the help. so what is best way to hide/change Server name? except Cloudflare.
    – Kimi
    Sep 6, 2013 at 15:52
  • depends on what do you use for dynamic pages. hard to tell.
    – GioMac
    Sep 6, 2013 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .