Wrong client IP: app sees the proxy/load balancer IP instead of the visitor
Logs, rate limits and geo rules all show one IP (the proxy) because the real client address is in a forwarded header.
all requests have the same IP load balancerREMOTE_ADDR shows the proxy IPclient IP is always 127.0.0.1X-Forwarded-For spoofingreal client IP behind Cloudflare Meaning
Behind a proxy or CDN the TCP peer is the proxy; the visitor is in X-Forwarded-For (or CF-Connecting-IP, X-Real-IP, PROXY protocol). Trust those headers only from your own proxies (set_real_ip_from, TRUSTED_PROXIES, trust proxy), otherwise users can spoof their IP.
Common causes
- App reads the socket address only
- Real-IP module not configured
- Trusting XFF from anyone (spoofing)
- Multiple proxy hops, wrong position in the list
- CDN IP ranges not whitelisted
⚡ Quick fix
- Configure trusted proxies and read the forwarded header
- nginx:
set_real_ip_from 10.0.0.0/8; real_ip_header X-Forwarded-For; - Use
CF-Connecting-IPbehind Cloudflare
Detailed fix by platform
Nginx
- nginx
set_real_ip_from 10.0.0.0/8; real_ip_header X-Forwarded-For; real_ip_recursive on;
How to diagnose
- Peer IP — Proxy?
- Trusted proxies — Configured?
- Header — Spoofable?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in HTTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026