[SOLVED]Setup NGINX + NodeBB on a subdomain
-
I think the tutorial you're referring to is a bit weird. It basically says "Use the default nGinx setup, and change everything!".
It's not very clear to me what the problem is in your setup. Do you see the default nGinx page when you open the subdomain? Or nothing at all?
I would recommend following the tutorials from the documentation. Here are the steps to take:
- Download the NodeBB release from github. I recommend to download a release, and not to use the current repository (as that is the development branch).
Based on this recommendation, you will end up with version 1.0.3. Here is the URL: https://github.com/NodeBB/NodeBB/archive/v1.0.3.tar.gz - Install NodeBB. Well, you stated that it is running, so I assume this is fine.
- Check if NodeBB is running. I assume you didn't block the ports (yet) with iptables, so you can access "http://ip:port". I assume this is working well.
- Now use the nGinx setup from the documentation:
https://nodebb.readthedocs.io/en/latest/configuring/proxies/nginx.html
Make sure server_name matches the subdomain you want to use. - You should be able to use your subdomain now.
Does this help?
- Download the NodeBB release from github. I recommend to download a release, and not to use the current repository (as that is the development branch).
-
Thanks for the fast reply!
When I open the subdomain I see nothing at all.
Here is a part of my nginx.conf:http { upstream nodebb { server IP:4567; } }
And here is the sites-available File:
server { listen 80; #listen [::]:80 default_server ipv6only=on; root /var/www/FORUMNAME/forums; index index.html index.htm; # Make site accessible from http://localhost/ server_name community.FORUMNAME.us; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules 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://nodebb; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
( i replaced the original ip with IP and the forum name with FORUMNAME.)
Anything wrong with that setup?
-
first of all... you don't need these two lines. they are useless.
root /var/www/FORUMNAME/forums; index index.html index.htm;
can you get to NodeBB using
http://Your IP:4567
? -
@pichalite Yes I can Access it and everything gets displayed as it should
-
@hans4arpei try changing this line
proxy_pass http://nodebb;
toproxy_pass http://Your IP:4567;
and restart nginx -
-
@hans4arpei are you sure your subdomain is hitting your IP?
comment out everything in the sites-available File... restart nginx and what do you see when you go to your subdomain?
-
@pichalite "Server not found"
The Subdomain exists and is pointing to the nodebb forum with an A record.
-
Maybe give the NGINX config from my high performance stack guide a try:https://community.nodebb.org/topic/8210/high-performance-stack/
Please note that you need to remove the PageSpeed and HHVM line from the config.
-
Solved. Cloudflare was the problem.