• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

#1
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
#2
Search the phpinfo for the IP address in one of the $_SERVER variables.

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