X-Forwarded-For Header Explained

What the HTTP X-Forwarded-For header does and when it's used.

Published October 15, 2026

The X-Forwarded-For header identifies the originating IP address of a client connecting through a proxy or load balancer.

Key points

  • Can contain a comma-separated chain of IPs if the request passed through multiple proxies
  • Should never be trusted blindly for security decisions, since a client can set it themselves unless a trusted proxy strips and re-sets it
More HTTP articles