Skip to content

Get the real visitor IP behind several proxies (nginx real_ip_recursive) — by Nick M on Server Fault

advancedforumCC BY-SA (Stack Exchange; version depends on post date)

When traffic passes through more than one proxy (for example a CDN, then a load balancer), nginx logs the wrong client address. The answer explains the realip module's real_ip_recursive option, which walks the X-Forwarded-For chain past your trusted proxies to the real client.

Read the full thread on serverfault.com

Source: Get the real visitor IP behind several proxies (nginx real_ip_recursive) by Nick M on Server Fault. Licence: CC BY-SA (Stack Exchange; version depends on post date).

Source reviewed
2026-11-02
Link checked
Not yet
Tested hands-on
Not by Oddbyte.Me

nginxx-forwarded-forreal iploggingcdn

More in Community Answers (Stack Exchange)