X-Forwarded-For HTTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

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.

Exact message you may see 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
Seen on: HTTP Nginx Laravel Node.js

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

  1. Configure trusted proxies and read the forwarded header
  2. nginx: set_real_ip_from 10.0.0.0/8; real_ip_header X-Forwarded-For;
  3. Use CF-Connecting-IP behind Cloudflare

Detailed fix by platform

Nginx

  1. nginx
    set_real_ip_from 10.0.0.0/8;
    real_ip_header X-Forwarded-For;
    real_ip_recursive on;

How to diagnose

  1. Peer IP — Proxy?
  2. Trusted proxies — Configured?
  3. 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:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

203 — HTTP 203 Non-Authoritative Information (HTTP)203401 — 401 because the Authorization header is stripped (HTTP)401429 — HTTP 429 Too Many Requests (HTTP)429463 — AWS ALB 463 X-Forwarded-For header has too many IP addresses (HTTP)463598 — HTTP 598 Network Read Timeout Error (HTTP)598Location — Redirect goes to the wrong host, port or scheme (bad Location header) (HTTP)LocationNODE_EXTRA_CA_CERTS — Node.js: UNABLE_TO_VERIFY_LEAF_SIGNATURE / SELF_SIGNED_CERT_IN_CHAIN behind a corporate proxy (NODE_EXTRA_CA_CERTS) (SSL / TLS)NODE_EXTRA_CA_CERTSPROXY protocol — PROXY protocol error: broken header / unexpected data from the load balancer (HTTP)PROXY protocolX-Forward…

Explore the map of this error Full error map →

🧠 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.