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

Moved to nginx, guest count now only 1

RobParker

Well-known member
#1
I'm not sure if this is a problem or not but overnight we moved from apache to nginx. This morning our users online guest count is 1. It's normally a couple of hundred and comprises of real users and crawlers.

Is there any reason nginx would stop this number being reported correctly?
 

Jake Bunce

XenForo moderator
Staff member
#2
Assuming the session count is not correct...

Are you using session caching?

http://xenforo.com/help/cache/

Code:
$config['cache']['cacheSessions'] = true;
With session caching enabled, a loss of all sessions can be explained by problems with the cache such as a lack of available memory or uptime problems with the cache server. Just guessing.
 

RobParker

Well-known member
#3
We're using APC for cache.

Also to be more specific our hosts "setup nginx as a reverse proxy to apache, due to this being an hsphere server. Nginx serves up any static content and caches it, while passing off any dynamicly generated requests over to apache for processing PHP"

Our members online count seems reasonable, it's just the guests online is reporting 1. Is this because of the proxy?
 

Jake Bunce

XenForo moderator
Staff member
#4
Our members online count seems reasonable, it's just the guests online is reporting 1. Is this because of the proxy?
It's possible. You can test it by visiting your forum as a guest to make sure the count reflects your visit. Or try removing the proxy temporarily to see if that affects anything.

Also:

If you wish to read and write XenForo sessions to the cache, add the following line to your library/config.php file:

$config['cache']['cacheSessions'] = true;

Note that your cache must have enough space to hold the sessions, or users may not be able to login properly. We do not recommend writing sessions to the cache if you are using APC as your cache back-end.
 

RobParker

Well-known member
#8
Our hosts: "added the following configuration into your mod_rpaf module:

RPAFproxy_ips 127.0.0.1 xx.xx.xxx.xx xx.xx.xxx.xx xx.xx.xxx.xx (our IP addresses removed)

In this configuration nginx is able to fetch the actual real client IP's from the apache server"