I have a wordpress site, let's call it domain.com. I would like to install NodeBB on domain.com/forum.
Since the hosting company doesn't support Node.js, I have to install the forum on Google Cloud (Ubuntu VM) and put it under subdomain forum.domain.com.
I use Cloudflare worker to point domain.com/forum to forum.domain.com, however all the links are broken (except for the assets - since I'm able to rewrite them all). For example, the categories link becomes domain.com/categories instead of domain.com/forum/categories, and so on.
I decide to install the forum on subfolder of the subdomain (ie: forum.domain.com/forum). By mimicking the subfolder, I hope the issue with the links will be gone. So far it looks good, the forum (domain.com/forum) shows the site without missing assets (CSS/JS/images). However, apparently there's an error with socket.io (Looks like your connection to the forum was lost, please wait while we try to reconnect).
Chrome Inspector shows repeater error with socket.io ( Failed to load resource: 404 /forum/socket.io/?EIO=3xxxxxx ). Same issue happens if I go straight to forum.domain.com/forum.
This is config.json:
{
"url": "http://forum.domain.com/forum/",
"secret": "123",
"database": "mongo",
"port": "4567",
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"database": "nodebb"
},
"socket.io": {
"origins": "http://forum.domain.com/forum:* http://forum.domain.com:*"
}
}
And this is NGINX config:
server {
listen 80;
server_name forum.domain.com;
return 302 https://$server_name$request_uri;
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_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-Host $host;
}
}
Can anyone help me?
Thanks!