HTTP_X_FORWARDED_FOR incorrect

[HTTP_X_FORWARDED_FOR] => 252.247.130.245
does not match whatismyip.com

Please help

That’s not a Cloudflare header. It’s probably an internal reverse proxy header on your server.
Cloudflare uses these:
CF-Connecting-IP
X-Forwarded-For

2 Likes

Perl, PHP, and I think a few others do prefix headers with “HTTP_”, so it would be “X-Forwarded-For” in this case, but it most likely still is an internal proxy.

1 Like

I had the setting from Cloudflare to overwrite the headers with IPV4 headers. Unfortunately I needed to gate some website content for exproxy, and cannot use IPV6. However these are from PHP $_SERVER. Thats probably PHP thats prepending to the key to turn X-Forwareded-For from the head to the server array HTTP_X_FORWARDED_FOR.

This problem went away on its own. I suspect there is some additional caching on Cloudflare which had to clear before the IPV4 headers were corrected.

Thanks
-chuck

And out of nowhere i cannot get the correct ipv4 again. The only thing i can conclude is that X-Forwarded-For is unreliable.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.