My raw access log is now filled with CloudFlare IP addresses. Is there any way I can use a .htacess file or configure the server to log the user's actual IP address?

With PHP, CloudFlare creates these environment variables for our reference, but I can't find anything similar for raw access logs.

Unfortunately, as suggested in this Stack Overflow question, using mod_cloudflare.c for the following is not an option on a shared hosting server:


We have solutions for restoring original visitor IP with CloudFlare in our knowledge base.

  • Bad answer with an inaccessible link – Novocaine Sep 4 '15 at 9:35
  • That link loads fine for me. In addition, the server logs can only be addressed by one of the solutions in the link. Try again. – damoncloudflare Sep 5 '15 at 3:37
  • Actually see the issue(there is a weird redirect on that URL). The solutions are outlined at: support.cloudflare.com/hc/en-us/sections/… – damoncloudflare Sep 5 '15 at 3:40
  • Yeah, link didn't work for me either, but I've edited the post with your updated one, thanks Damon. – Simon East Sep 10 '15 at 7:00
  • The OP already tried mod_cloudflare but can't use it on shared hosting. Unfortunately this doesn't actually answer the question of how to get these in that case. – Andrew Lott Sep 10 '15 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.