Pass forward X-Real-IP to nginx backend server (#901)

The TLS termination server sets X-Real-IP to be used by the back-end, but the back-end configuration example doesn't actually extract it so nginx logs (and back-end processing) fails to log or use the visiting IP in any way (it just states `unix:` if using a unix socket like in the example given, or the local IP if forwarded over TCP).

Adding real_ip_header to the config will fix this.

Signed-off-by: Moonchild <moonchild@palemoon.org>
This commit is contained in:
Moonchild 2025-07-24 14:11:53 +02:00 committed by GitHub
parent 1cb1352a44
commit 21f570962c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,6 +79,10 @@ server {
root "/srv/http/anubistest.techaro.lol";
index index.html;
# Get the visiting IP from the TLS termination server
set_real_ip_from unix:;
real_ip_header X-Real-IP;
# Your normal configuration can go here
# location .php { fastcgi...} etc.
}