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

XF 1.3 Wrong User's IP When Using Cloudflare

Discussion in 'Troubleshooting and Problems' started by semprot, Jun 5, 2014.

  1. semprot

    semprot Active Member

    Xenforo detects wrong user's IP address when the domain uses CloudFlare (cloudflare's IP becomes user's IP).
    My server has installed mod_cloudflare.
    I also have another website (a drupal) on the same server, and it detects user's IP perfectly.

    Why it's only XF that detects wrong user's IP?
     
  2. Liam W

    Liam W Well-Known Member

    Cloudflare masks the IP using their own IP.

    The only way to get around this is to add a snippet of code to the config.php file that sets the remote IP value to the value of the users IP provided in a header by cloudflare.

    Or, remove cloudflare.
     
  3. semprot

    semprot Active Member

    Using mod_cloudflare on my server should resolve the problem automatically (according to cloudflare's documentation).
    But XF is the only site on my server that doesn't detect IP correctly, my other website (but not xenforo site) on same server detects the IP correctly.

    Update : strange mod_cloudflare doesn't fix automatically.
    I have to do some file edits and it works :D
    https://support.cloudflare.com/hc/e...o-I-restore-original-visitor-IP-with-XenForo-
     
    Last edited: Jun 5, 2014

Share This Page