Didn't work
config.json updated:
"url": "https://example.com/forum"
Didn't work
config.json updated:
"url": "https://example.com/forum"
Archeology level up, I know, I'm sorry
I get the same problem with the forum configured to be accessible via a subfolder. It is a fresh installation
HTTP is fine (the forum loads fine) but WebSocket is not ("Looks like your connection to NodeBB was lost, please wait while we try to reconnect." message in the bottom right corner)
If I start the forum in development mode, everything runs fine (both HTTP and WS)
Nginx version: 1.10.3
NodeJS version: 8.6.0
NodeBB version: 1.6.0
nginx configuration
server {
listen 80;
listen [::]:80;
server_name example.com;
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com;
index index.html;
root /var/www/html/example;
ssl_certificate /etc/letsencrypt/live/example.com/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
location / {
try_files $uri $uri/ =404;
}
location /forum/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://localhost:4567;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
config.json
{
"url": "https://example.com/forum/",
"secret": -not shown-,
"database": "mongo",
"mongo": {-not shown-},
"bind_address": "127.0.0.1"
}
NodeBB logs
6/10 15:12:55 [5514] - info: Initializing NodeBB v1.6.0 https://example.com/forum/
6/10 15:12:56 [5514] - info: [socket.io] Restricting access to origin: https://example.com:*
6/10 15:12:57 [5514] - info: Routes added
6/10 15:12:57 [5514] - info: NodeBB Ready
6/10 15:12:57 [5514] - info: Enabling 'trust proxy'
6/10 15:12:57 [5514] - info: NodeBB is now listening on: 127.0.0.1:4567
nginx access log:
my.ip.v4.address - - [06/Oct/2017:15:27:55 +0200] "GET /forum/socket.io/?EIO=3&transport=polling&t=LxntlbI HTTP/1.1" 403 43 "https://example.com/forum/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
nginx error.log:
2017/10/06 15:12:55 [error] 4221#4221: *494 connect() failed (111: Connection refused) while connecting to upstream, client: my.ip.v4.address, server: example.com, request: "GET /forum/socket.io/?EIO=3&transport=polling&t=LxnqJud HTTP/1.1", upstream: "http://127.0.0.1:4567/forum/socket.io/?EIO=3&transport=polling&t=LxnqJud", host: "example.com", referrer: "https://example.com/forum/"