Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can remove Nginx from http response header?

Tags:

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

like image 400
sahar shokouhi Avatar asked Apr 07 '12 08:04

sahar shokouhi


People also ask

How do I remove unwanted HTTP response headers?

Open the site which you would like to open and then click on the HTTP Response Headers option. Click on the X-Powered-By header and then click Remove on the Actions Pane to remove it from the response.


1 Answers

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';
like image 51
davidjb Avatar answered Sep 22 '22 14:09

davidjb