X-Forwarded-For

Original client IP when request passes through proxies/load balancers. Comma-separated list.

Request

Syntax

X-Forwarded-For: <client>, <proxy1>, <proxy2>

Example values

ValueExplanation
203.0.113.195Direct client
203.0.113.195, 70.41.3.18Client and proxy

cURL usage

curl -H "X-Forwarded-For: 1.2.3.4" https://api.example.com

Common mistakes

Trusting without validation (spoofable); use rightmost for last proxy.

Related headers

Tools

HTTP Header Viewer →