4

I could not able to remove 'Server' header from response header of Nginx version 1.18 in Ubuntu 20.04 OS.

I have done the following steps:

  1. sudo apt-get update

  2. Installed nginx-extras by using command 'sudo apt-get install nginx-extras'

  3. Added the code snippet 'more_clear_headers Server;' in http section of nginx.conf file.

After restarting the Nginx service, it shows the error that 'unknown directive more_clear_headers'.

But, I could remove 'Server' header from response header of Nginx version 1.4.6 in Ubuntu 14.04 OS by doing the above steps.

Can anyone please help me how could I remove 'Server' header from response header of Nginx 1.18 in Ubuntu 20.04 OS?

Thanks In Advance

Tijo
  • 93
  • 1
  • 5

1 Answers1

9

You should load the 'ngx_http_headers_more_filter_module.so' by adding the below code snippet in nginx.conf file.

load_module modules/ngx_http_headers_more_filter_module.so;

It will work.

Cheers!

Alex
  • 790
  • 1
  • 7
  • 22