Welcome! Log In Create A New Profile

Advanced

RE: Hide HTTP headers in nginx

Reinis Rozitis
November 13, 2020 05:04AM
> As part of the security audit, I have set server_tokens off; in /etc/nginx/nginx.conf. Is there a way to hide Server: nginx, X-Powered-By and X-Generator?
>
> To hide the below HTTP headers
>
> Server: nginx
> X-Powered-By: PHP/7.2.34
> X-Generator: Drupal 8 (https://www.drupal.org)

Afaik the Nginx header is hardcoded, so to remove it you have either to change the source/recompile or run through a proxy which can remove http headers.

For the php header you have to change php.ini and set: expose_php = Off

For Drupal there are several modules/plugins which let you remove the header (for example https://www.drupal.org/project/remove_http_headers )


rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Hide HTTP headers in nginx

kaushalshriyan November 12, 2020 07:34PM

RE: Hide HTTP headers in nginx

Reinis Rozitis November 13, 2020 05:04AM

Re: Hide HTTP headers in nginx

Francis Daly November 13, 2020 06:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 318
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready