Introduction: The Paper Trail

When you use a proxy or a load balancer, the website's server technically only sees the IP address of that middleman. This would make it impossible for the website to know who you are. To fix this, engineers created a header called X-Forwarded-For (XFF). It acts as a digital paper trail that records the 'original' IP address of the person who started the request.

In this guide, we'll explain how this header works and why it is the most important data point for web security and personalized content.

How It Works: The Chain of Custody

Imagine you give a letter to a friend to deliver to a neighbor. Your friend writes your name on the back of the envelope so the neighbor knows who sent it. That note on the back is the XFF header. When a proxy receives your request, it takes your Client IP and adds it to the X-Forwarded-For field before passing the request to the website's server.

If there are multiple proxies, the header becomes a comma-separated list: Client-IP, Proxy1-IP, Proxy2-IP.

Why Does This Matter for Privacy?

  • Identity Exposure: If your proxy isn't configured for 'High Anonymity', it will automatically add your real home IP to the XFF header, telling the website exactly who you are.
  • Bypassing Blocks: Some websites are smart. Even if you use a proxy to hide your IP, they check the XFF header. If they see your real IP is actually from a blocked country, they will still stop you from entering.

Conclusion

The X-Forwarded-For header is the silent witness of the internet. It ensures that the 'truth' of where a request started is almost always available—if you know where to look. See what your XFF header says about you here.