XF 1.5 Can't find real user IPs when using SSL with cloudflare

sdrothrock

Member
config.php contains the recommended snippets:

Code:
 38 if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
 39 {
 40     $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
 41 }
 42
 43 if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
 44 {
 45     $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
 46 }
Checking /admin.php?tools/phpinfo shows that neither of those are actually included from cloudflare.

Any ideas?
 

Brogan

XenForo moderator
Staff member
Search the phpinfo for the IP address in one of the $_SERVER variables.

You would use whichever one it is in the above code.
 

sdrothrock

Member
Search the phpinfo for the IP address in one of the $_SERVER variables.

You would use whichever one it is in the above code.
It wasn't in there and I discovered why -- I'd set Cloudflare to serve DNS only and completely forgotten about it. Classic PEBCAK. :(
 
Top