I get error:
Session Mismatch
It looks like your login session is no longer active, or no longer matches with the server. Please refresh this page.
When I click [OK] it appears again (infinitely).
My server config is:
upstream io_nodes {
ip_hash;
server 127.0.0.1:4567;
server 127.0.0.1:4568;
server 127.0.0.1:4569;
}
server {
server_name example.com;
listen 192.168.100.42;
listen 192.168.100.42:443 ssl;
listen [::];
listen [::]:443 ssl;
ssl_certificate /home/userhomedir/ssl.cert;
ssl_certificate_key /home/userhomedir/ssl.key;
root /home/userhomedir/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/example.com_access_log;
error_log /var/log/virtualmin/example.com_error_log;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
# if ($host ~ ^www\.) {
# return 301 https://example.com$request_uri;
# }
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
# https://github.com/NodeBB/NodeBB/issues/4734
proxy_set_header X-Forwarded-Proto $scheme;
# Socket.io Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
gzip on;
gzip_min_length 1000;
gzip_proxied off;
gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
location @nodebb {
proxy_pass http://io_nodes;
}
location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
root /home/usernodebb/nodebb/public;
try_files $uri $uri/ @nodebb;
}
location / {
proxy_pass http://io_nodes;
}
} # end of server example.com
server {
server_name live.example.com;
listen 192.168.100.42:443 ssl;
listen [::]:443 ssl;
ssl_certificate /home/userhomedir/ssl.cert;
ssl_certificate_key /home/userhomedir/ssl.key;
access_log /var/log/virtualmin/live.example.com_access_log;
error_log /var/log/virtualmin/live.example.com_error_log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
# https://github.com/NodeBB/NodeBB/issues/4734
proxy_set_header X-Forwarded-Proto $scheme;
# Socket.io Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
gzip on;
gzip_min_length 1000;
gzip_proxied off;
gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
proxy_pass http://io_nodes;
} # end of location block
} # end of server live.example.com
My config.json
is:
{
"url": "https://example.com",
"port": [4567,4568,4569],
"bind_address": "127.0.0.1",
"secret": "<hehehe>",
"database": "mongo",
"socket.io": {
"transports": ["websocket", "polling"],
"address": "live.example.com"
},
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "nodebb",
"password": "<hehehe>",
"database": "nodebb"
},
"redis": {
"host":"127.0.0.1",
"port":"6379",
"password":"<hehehe>",
"database": 0
}
}
It is not working the same way also if I change
"socket.io": {
"transports": ["websocket", "polling"],
"address": "live.example.com"
},
to
"socket.io": {
"transports": ["websocket", "polling"],
"address": "https://live.example.com"
},
I tried first to visit https://live.example.com first and then https://example.com. This way I don't see the error message. However, when I delete all of the browser cookies and visit https://example.com directly - it shows the same error.
When I visit https://live.example.com/ it did not show the error message, however I don't want visitors to use the subdomain to access the website (because this way caching of images by CloudFlare/Incapsula will not work).
Tried to downgrade socket.io - no effect.
Reported here: https://github.com/NodeBB/NodeBB/issues/5430