nixos/nginx: set X-Forwarded-Server proxy header to hostname

X-Forwarded-Server represents the last server in a row of reverse proxies
in the common use, see:
- https://www.fastly.com/documentation/reference/http/http-headers/X-Forwarded-Server/
- https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers
- https://docs.valsight.com/on-premise/latest/reverse-proxy

X-Forwarded-Host instead is the original request host.

This change adapts our NGINX module to the common use of this header.
This commit is contained in:
Leona Maroni
2025-09-23 21:58:31 +02:00
parent 88edfc580f
commit 33dc105554
2 changed files with 3 additions and 1 deletions

View File

@@ -108,7 +108,7 @@ let
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Server $hostname;
'';
proxyCachePathConfig = concatStringsSep "\n" (