How does Cloudflare's proxying affect the accuracy of IP address retrieval?

Responsive Ad Header

Question

Grade: Education Subject: Support
How does Cloudflare's proxying affect the accuracy of IP address retrieval?
Asked by:
75 Viewed 75 Answers

Answer (75)

Best Answer
(445)
Cloudflare's proxying introduces an intermediary layer between the client and your server. This means that `$_SERVER['REMOTE_ADDR']` will always reflect Cloudflare's IP address, not the client's. `$_SERVER['HTTP_CF_CONNECTING_IP']` attempts to bypass this by forwarding the original client's IP address. However, the proxying process can sometimes interfere with header forwarding, making `HTTP_CF_CONNECTING_IP` unreliable in certain scenarios.