Question
How does Cloudflare's proxying affect the accuracy of IP address retrieval?
Asked by: USER1778
75 Viewed
75 Answers
Answer (75)
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.