After writing this post on how to override Magento’s HTTP helper to pull in the ‘real’ remote ip address when behind a reverse proxy system like Cloudflare. After reading this, Jack at firstvapor.com helpfully wrote in to point out the right way of doing this.
If you look in /app/etc/local.xml.additional there’s some extra nodes in there that you can copy into your local.xml to add additonal funcitonality… and one of the things you can do is add remote headers for reverse proxies.
so, copy the following code into your local.xml under the ‘global’ node:
<remote_addr_headers><!-- list headers that contain real client IP if webserver is behind a reverse proxy --> <header1>HTTP_CF_CONNECTING_IP</header1> </remote_addr_headers>
And that should do the trick! I’ll leave the other article up as it’s a good tutorial for overriding a helper anyway, but this method is much simpler.