Home > Mobile >  Clearing All Response Headers in NGINX
Clearing All Response Headers in NGINX

Time:03-23

I understand that I can use one of the following to remove specific headers from the response in NGINX

proxy_hide_header
more_clear_headers

proxy_hide_header

more_clear_headers

However, As I mentioned, my requirement is to remove all of the response headers. Above directives will only help in removing specified headers. Is there any way I can remove all headers before sending the response?

CodePudding user response:

more_clear_headers supports wildcard *

so this works for all X-Headers: more_clear_headers 'X-*';

Never tried but I assume that also more_clear_headers '*'; works.

But you have to build from source for using headers-more-nginx-modul.

  • Related