[SOLVED]Setup NGINX + NodeBB on a subdomain

  • I was following this tutorial: http://www.blogsynthesis.com/nginx-as-nodebb-proxy/

    NodeBB is running, nginx is running.
    I did EXACTLY everything described there, but still the subdomain wont show up the NodeBB forums.

    What i did:
    Followed the tutorial step by step
    Setup subdomain on my hoster
    Point the A record of the subdomain to the digital ocean droplet( forum)

    Any help?

  • Gamers

    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:

    1. 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
    2. Install NodeBB. Well, you stated that it is running, so I assume this is fine.
    3. 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.
    4. Now use the nGinx setup from the documentation:
      Make sure server_name matches the subdomain you want to use.
    5. You should be able to use your subdomain now.

    Does this help?

  • 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?

  • Plugin & Theme Dev


    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

  • Plugin & Theme Dev

    @hans4arpei try changing this line proxy_pass http://nodebb; to proxy_pass http://Your IP:4567; and restart nginx

  • @pichalite said in Setup NGINX + NodeBB on a subdomain:

    our IP:4567;

    Still no changes

  • Plugin & Theme Dev

    @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.

Log in to reply

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.