Page 1 of 1

Cloudfare + Register User IP

Posted: Tue Aug 07, 2012 7:42 pm
by hellreturn
I am using cloudfare for my store but for some reason each time it get's cloudfare IP when user register. Is it possible to have real store IP instead of cloud fare IP?

Thanks!

Re: Cloudfare + Register User IP

Posted: Tue Aug 07, 2012 9:35 pm
by MarketInSG
check with cloudfare. I think it routes through their server and you will need them for help.

Re: Cloudfare + Register User IP

Posted: Tue Aug 07, 2012 9:40 pm
by bigchili

Re: Cloudfare + Register User IP

Posted: Tue Aug 07, 2012 10:06 pm
by hellreturn
Can someone please tell me where to put this code, I mean in what file?

http://support.cloudflare.com/cgi/kb/wh ... hould-i-do

Thanks!

Re: Cloudfare + Register User IP

Posted: Wed Aug 08, 2012 1:41 pm
by hellreturn
Bump

Re: Cloudfare + Register User IP

Posted: Wed Aug 08, 2012 8:48 pm
by MarketInSG
open system/library/customer.php

find ALL

Code: Select all

REMOTE_ADDR
change to

Code: Select all

HTTP_CF_CONNECTING_IP

Re: Cloudfare + Register User IP

Posted: Sat Sep 29, 2012 11:52 am
by netops
Add following near beginning of index.php
right after //Version

This will pickup IP for direct clients as well.

Code: Select all

// Cloudflare CDN
if ($_SERVER["HTTP_CF_CONNECTING_IP"]) {
        $_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
       }