diff --git a/docs/install.md b/docs/install.md index 3c41778..a837518 100644 --- a/docs/install.md +++ b/docs/install.md @@ -274,6 +274,25 @@ next paragraph for why it matters). Whichever proxy you use, headers that need forwarding either way, including that overwrite-not- append distinction for `X-Forwarded-For`. +**Nginx Proxy Manager specifically:** NPM's generated config already sets +`X-Forwarded-For` to the appending (unsafe) form by default — override it +per proxy host rather than editing NPM's own templates: open the proxy +host entry for Evection, go to its **Advanced** tab, and add this to the +**Custom Nginx Configuration** box: + +```nginx +proxy_set_header X-Forwarded-For $remote_addr; +``` + +This lands inside NPM's own `location` block, after its default headers, +so nginx uses this one (the last `proxy_set_header` for a given name in +the same block wins) — no edit to any file NPM manages, and it survives +NPM regenerating its config. Save, and NPM reloads nginx for you. If +something else sits in front of NPM itself (a CDN, another load balancer, +Cloudflare, ...), `$remote_addr` at NPM's layer is that upstream's +address, not the original client — forward whatever *that* layer's own +trusted client-IP header says instead. + Either way, the proxy must set `X-Forwarded-Proto: https` on requests it forwards once it's terminating TLS — Evection's `prod` settings (`SECURE_PROXY_SSL_HEADER` in `config/settings/prod.py`) trust that header to