How can remove Nginx from http response header?

sahar shokouhi picture sahar shokouhi · Apr 7, 2012 · Viewed 34k times · Source

I want to remove Nginx from http response header. I can Hide my Nginx version but I want to hide Nginx too. Thanks

Answer

davidjb picture davidjb · Apr 18, 2013

Use the ngx_headers_more module - see http://wiki.nginx.org/NginxHttpHeadersMoreModule.

It allows you to configure any arbitrary headers you'd like - both request and response headers. Once you've installed it (and thus recompiled your version of Nginx), use the following configuration:

more_set_headers 'Server: my-server';

Alternatively, if you don't want a Server header at all, then clear it using:

more_clear_headers 'Server';