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

XF 1.3 Apache to NGINX - now the members stats are wrong

Discussion in 'Troubleshooting and Problems' started by Stuart Wright, Mar 22, 2014.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    For years, from vbulletin through to before we changed over to NGINX this week, we've always has about 3 to 4 times more guests than members and something like 3 to 4 thousand in total online during waking hours.
    However since the swap to NGINX, we have a tiny number of guests. The number of visitors is maybe about the same.
    Any idea what this could be? A sessions issue maybe? I don't know anything about servers so I have no clue.
    I see this as urgent. Any help appreciated.
  2. Mike

    Mike XenForo Developer Staff Member

    It's worth looking at the IP addresses on the online members list to see if they're different - for guests, each IP will only be counted once. If they're not what you expect, it sounds like there may now be a reverse proxy involved. You'll want to change the IP shown to XenForo to be the real IP which will likely be forwarded through a header. You can change this by overwriting the wrong IP via config.php or see if there's a system to change the IP at the web server level (as the wrong IPs will likely be logged against your server without that anyway).
  3. Stuart Wright

    Stuart Wright Well-Known Member

    Thanks Mike. I'll send Tim to this thread as it's beyond me.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. Stuart Wright

    Stuart Wright Well-Known Member

    Thanks @Jake Bunce I had a look at the member list and the first one had no IP. Several members have been online with no recorded IP.

    Also I'm assuming 'no value' for the _SERVER["REMOTE_ADDR"] is the problem here?

  6. Mike

    Mike XenForo Developer Staff Member

    Yeah, that is the issue. That should be forwarded on from the web server. (It would be known to be the actual connecting IP due to the TCP handshake.)
  7. Null

    Null Well-Known Member

    $_SERVER['HTTP_X_REAL_IP'] contains your actual IP address, you'll need to stick that in your configuration file as @Jake Bunce pointed out the post he linked.
    MattW likes this.
  8. Mike

    Mike XenForo Developer Staff Member

    I didn't even notice that. Good catch. :)
    Null likes this.
  9. Stuart Wright

    Stuart Wright Well-Known Member

    Tim tweaked it and we're good, many thanks for your quick responses. Much appreciated.

Share This Page