Deploy NodeBB in a subfolder of a site
-
Can anyone give a full document about how to deploy NodeBB in a subfolder of a site?
I googled and tried without success as expected . (The NodeBB can start and access as http://***.domain.com:4567/forum (expected))
Some of my questions:
- How to config to make NodeBB works together with the site, since NodeBB start will listen to a port and the host site need that port too.
- Is it possible the start NodeBB only (http://.domain.com:4567/forum) and provides access to some items such as static pages ( ex: http://.domain.com:4567/test.html)
I'm trying to use NodeBB in Cloud 9, any suggestion / direction about deploy NodeBB is welcome.
Thanks in advance.
-
Nodebb config should look like this:
{ "url": "http://domain.com/forum", "secret": "somehash", "database": "redis", "redis": { "host": "127.0.0.1", "port": "6379", "password": "somepass", "database": "0" } }
Your nginx config (in case you use nginx) should look something like this:
server { listen 80; server_name domain.com; #charset koi8-r; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error_log; location / { some code for /; } location ^~ /forum { 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"; } }
-
"location ^~ /forum {"
-
@Henry-Jia said:
Could you please tell me if there has some limitation such as where to deploy the NodeBB.
It does not have any known limitation.
-
@ A Former User
I just wanted to note that the regex isn't necessary. I just installed and my working config is as follows:location /forum/ { proxy_pass http://172.17.2.3:4567; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; 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 X-NginX-Proxy true; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; }
Copyright © 2024 NodeBB | Contributors