22

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

1
  • Adding a comment for those ending here searching like me. If your Nginx is dealing mostly with upstream servers (and if not you can always make your actual server config an upstream of an extra webserver), you can use proxy_hide_headers to remove the headers coming from the upstream in the response Commented Aug 29, 2022 at 18:50

1 Answer 1

32

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';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.