I'm posting this under Bug Reports knowing that it might not have anything to do with NodeBB itself. Most likely, it's an Nginx configuration issue.
And this is a continuation of Testing Subfolder Installation and Encountered Uncaught Exception: meta is not defined.
Ok, so I've been trying to get a production installation of NodeBB running on a WP site powered by Nginx (1.4.6), Varnish and php-fpm. This should be the easiest thing to configure, but for some reason, it's not working on my site, even though I can access NodeBB without using Nginx proxy. This attempt is to run NodeBB from forum.mysite.com, after failing to run it from a subfolder. The error from both attempts is:
[error] 9921#0: *148 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: forum.mysite.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:4567/", host: "forum.mysite.com"
The connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server:
error is the same one I get when I attempt to access NodeBB from a subfolder on the same server, so this is not likely a DNS issue. Btw, I can access another WP site from a subdomain on the same server.
The Nginx config for /sites-available/forum.mysite.com is:
NOTE: Nginx is listening on 8080, while Varnish is listening on 80.
#
server {
server_name forum.mysite.com www.forum.site.com;
listen 8080;
## Settings for proxying Node.JS forum installation.
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_pass http://127.0.0.1:4567/;
proxy_redirect off;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
And NodeBB's config.json is:
{
"base_url": "http://127.0.0.1",
"port": "4567",
"use_port": true,
"secret": "secret",
"bind_address": "0.0.0.0",
"database": "redis",
"redis": {
"host": "127.0.0.1",
"port": "6379",
"password": "secret2",
"database": "0"
},
"bcrypt_rounds": 12,
"upload_path": "/public/uploads",
"relative_path": ""
}
I have the feeling that there's s minor configuration issue that's stopping the proxy-ing not to work correctly. Need anotehr pair of eyes on this forum to help me figure out what the node is going on.