Problems with NGINX config.

General Discussion
  • #1

    hey guys,
    fell in love with NodeBB as soon as i saw it, so i had to get it going for myself.
    signed up for a digital ocean droplet and seemed to have everything working.

    the only problem i have come across is with the NGINX proxy/redirect. i have never worked with it before, and while i have tried, it just doesn't seem to be working for me.

    i am trying to get the forum working on a subdomain from our main site, and without the need for the port.
    i have managed to get the subdomain working fine, as you can see at but without the port there, it just shows the NGINX holding page.

    can anyone help me to get this working? i feel like i have just been going round in circles trying to get it to work...

    I have the NGINX config in a number of places:


    using the same setup as the wiki ( with NGINX 1.4.7

    my config.json file is as follows (with sensitive info removed)

        "base_url": "",
        "port": "4567",
        "use_port": true,
        "secret": "XXXXX",
        "bind_address": "",
        "database": "redis",
        "redis": {
            "host": "",
            "port": "6379",
            "password": "XXXXX",
            "database": "0"
        "bcrypt_rounds": 12,
        "upload_path": "/public/uploads",
        "relative_path": ""

    any pointers?

  • GNU/Linux

    @QWUX Let's give this a shot 🙂

    1. Set use_port to false -- this won't fix anything, but if you're using nginx as a proxy, it should be set to false.
    2. Set bind_address to -- no need to set it to anything different, in fact, I'm surprised it works at all since it's set to listen to the loopback iface.
    3. Remove the NodeBB nginx config lines from all of the files you specified, then (using sudo, or as root):
      • cd /etc/nginx/sites-available
      • nano
      • Paste the contents of that nginx config into that file you just opened/created, then save & exit
      • cd ../sites-enabled
      • ln -s ../sites-available/
      • service nginx reload

    Then run NodeBB, and give it a shot.

  • #3

    @julian thanks so much for your help.
    i started with a fresh install, and followed your instructions.
    everything seemed to work up until the
    service nginx reload. it says fail.

    any ideas?

  • #4

    also, i haven't been able to get any of the forever/supervisor installs to work. if the server reboots, nodebb still needs manual restart.

    i really like the way nodebb works and i want to use it for this project, but i fear the install process is still outside my skill level.

  • #5


    The proxy configuration is obviously not working. Post the entire config for the forums Nginx file here and see if you can find any messages from /var/log/nginx/error.log that you can post here.

  • #6

    @planner thanks for the quick reply...


    server {
    listen 80;

    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_redirect off;
        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";


    the error log located where you asked is empty.
    and i believe i had made a symlink in sites-enabled in the nginx dir.

  • #7


    No need for posting the contents of nginx.conf. You may edit the post and delete that part and enclose the entire contents of inside the code block.

    I think the problem it's not working properly is that the proxy_pass value does not match the base_url value in config.json. Set proxy_pass; and see if that works. Don't forget to restart Nginx and NodeBB before testing.

  • GNU/Linux

    @QWUX said:

    service nginx reload. it says fail.

    Can you paste the entire error message?

  • #9

    @ planner @julian thanks for all the help guys.
    this is where i have gotten -

    i updated the sites-available/ to have the proxy pass; - but still just shows the nginx start page.

    now, for some reason, after i installed the Facebook sso plugin, i can not login normally, the login page only shows the alternate login (fb).

    i got the nginx service to restart, just fine thank you @julian

  • GNU/Linux

    If only the alternate login shows up, then local logins were disabled -- do you remember doing this?

  • #11

    i didn't remember doing it, but i have got them back (by reverting to a snapshot of my droplet).

    so, at this stage, still don't have the nginx proxy/redirect working, and when users are logged in, the top bar doesn't have the conditional menu as shown on this forum, it just displays "register login" as though no user were logged in. but when in the admin section, my user avatar shows up there.

  • #12


    This is not working and Nginx's error log is empty. There's obviously something that's misconfigured. Are you running anything in front of Nginx, like a cache server?

  • #13

    @planner - as far as i am aware, no. this is my first time doing this kind of thing though. i used the NODEBB for dummies install guide.

    haha its making me feel stupid.

    i am so thankful for all the help so far, this is by far one of the most active and helpful communities i have encountered.

    how would i find out if i am running a cache server? would it be easier i if created a login for one of you? i don't want to keep taking up your time if i keep breaking things, but i am dead certain that of all the forum software i have seen, i want to use NodeBB for sure.

  • #14


    Well, how did you set up the original website before installing NodeBB? And just out of curiosity, did you install Nginx fresh with NodeBB or Nginx is the Web server that powered the site before you installed NodeBB?

Suggested Topics

  • 0 Votes
    2 Posts

  • 0 Votes
    6 Posts

  • New theme problems

    General Discussion
    0 Votes
    26 Posts

  • 0 Votes
    3 Posts

| | | |