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

XF 1.4 Members With Server IP Address

Discussion in 'Troubleshooting and Problems' started by Joker Black, Sep 14, 2014.

  1. Joker Black

    Joker Black Member

    I use OpenShift server.
    When setting XenForo, members are displayed as server IP address.
    How can I fix it?

    Thanks!
     
  2. Tracy Perry

    Tracy Perry Well-Known Member

    Are you using a proxy service? If so, there is a config.php entry that you can make to grab the correct IP.
    I used to use CloudFlare and had to use this
    Code:
    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
    in config.php and it solved that issue.

    Some posts I found using the search term $_SERVER['REMOTE_ADDR turned up this
    https://xenforo.com/community/threads/1-guest-online.71115/
    https://xenforo.com/community/threads/ip-check-showing-multiple-unrelated-people.73531/#post-761676
    https://xenforo.com/community/threads/all-users-have-the-same-ip.74440/
     
    Last edited: Sep 14, 2014
    thedude and Joker Black like this.
  3. Joker Black

    Joker Black Member

    I don't use any proxy services.
    Use CDN of MaxCDN, but it doesn't affect the user's ip address.
     
  4. Tracy Perry

    Tracy Perry Well-Known Member

    If the IP is being changed to the same thing, then yes, somewhere you are using a proxy (whether you realize it or not) most likely. Are you on a shared hosting environment?
     
  5. Joker Black

    Joker Black Member

    In config.php, I added this code and it is very effective
    PHP:
    $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_X_FORWARDED_FOR"];
     
  6. Tracy Perry

    Tracy Perry Well-Known Member

    That indicates that your hosting provider is using a proxy on the front end (could be nginx or varnish or something similar). You may not have known about it if you are on shared hosting, but glad it resolved the problem.
     
    Joker Black likes this.
  7. Joker Black

    Joker Black Member

    Thank you for helping me.
     
  8. Tracy Perry

    Tracy Perry Well-Known Member

    Your'e most welcome... that's one of the nice things about the XenForo users... most of us try to help out whenever possible.
     
    Joker Black and Clay Culver like this.

Share This Page