nginix set_real_ip_from

This commit is contained in:
cpu
2025-05-08 17:23:21 +02:00
parent 654d7433d0
commit f2786e116a

View File

@@ -15,12 +15,12 @@ set_real_ip_from 172.22.0.0/16; # Example: Trust IPs from this subnet
# Which header contains the real client IP?
# X-Forwarded-For handles multiple proxies better. X-Real-IP is simpler if only Traefik.
real_ip_header X-Forwarded-For;
real_ip_header X-Real-IP;
# If using X-Forwarded-For, tell Nginx how to process it.
# 'on' means find the *last* IP address that is NOT from a trusted proxy.
# This is usually correct when behind one or more trusted proxies.
real_ip_recursive on;
real_ip_recursive off;
# --- End Real IP Configuration ---