• Hi, first post here! I am evaluating a number of forum solutions; the usual suspects, Discourse, Vanilla, and now NodeBB. I also had a look at some of the more traditional forums like Flux, and some newer ones like Esotalk.

    I first tried NodeBB 6 months, this community has really grown since I last visited. NodeBB itself seems snappier.

    I just set up an Nginx reverse proxy following the official NodeBB docs and am trying to test the activation email with the mandril plugin and it seems to add the port 4567 in the activation email url which fails. I have use_port: false in the config.json, and the base url set to forum.example.com.

    For instance if base url is set to forum.example.com then the activation email by mandrill has the url as forum.example.com/4567/xyxxxx which in a reverse proxy nginx will fail to resolve. Any solutions? The forum search seems to be down at the moment, or unavailable for new users, and Google site search isn't helping either. I am sure I am missing something blindingly obvious.

    Thanks


  • @raul What's the server name set to in your nginx block under sites-available?

    http://127.0.0.1:4657?

    Did you restart nodebb when you changed use port to false?


  • Hi,

    Thanks for your help with this, server name in Nginx is the same as base_url - forum.example.com, proxy_pass is to the ip:port. And I have been restarting nodebb to ensure the new settings take effect, just to be doubly sure.

    I tried over 9 registrations convinced I am making the usual silly but frustrating errors that are often the biggest time sinks, and each one has the 4587 port which will not resolve. This is on the latest NodeBB 0.4.3, could this be an issue with the url generated by the mandril plugin, is that working well for others?

    Thanks


  • Do you get any output when you run sudo nginx -t?

    I use mandrill with no problems on master, so it seems down to the configuration.


  • Oops a silly typo on my end on my first post.

    To clarify the activation url generated by mandrill has the nodebb port in the url itself like this forum.example.com:4587/xyzzxx

    The nginx setup itself seems to be ok, nginx -t test is successful without issues so far. Since it's working for you this must be some configuration error on my end, this is a brand new testing instance of NodeBB built yesterday, no customization so far. Let me try another rebuild and check. Thanks.


  • @raul can you post your nginx server block file here (you can remove any info relating to the server or the URL if you like).

    The default port for nodebb is 4567, worth making sure that you've not mismatched the ports in config.json and your server block.


  • @a_5mith

    upstream nodebb  {
          server 127.0.0.1:4567; #nodebb
    }
    
    server {
            listen  80;
            server_name     forums.mynodebb.org;
    
            location / {
                    proxy_pass      http://nodebb;
                    proxy_redirect  off;
                    proxy_set_header        Host $http_host;
                    proxy_set_header        X-Real-IP $remote_addr;
                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_$
                    proxy_set_header X-NginX-Proxy true;
    
                    # Socket.IO Support
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                }
         }
    

    config.json

    {
        "base_url": "http://forums.mynodebb.org",
        "port": "4567",
        "use_port": false,
        "secret": "xxx",
        "bind_address": "0.0.0.0",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "0"
        },
        "bcrypt_rounds": 12,
        "upload_path": "/public/uploads",
        "use_port": false,
        "relative_path": ""
    }
    

  • @raul Have you tried removing 4567 from your upstream nodebb?

    I don't use it on mine, don't entirely know what it does. 😆 Everything else looks ok though.

  • GNU/Linux Admin

    @raul Very weird! Can you try sending yourself a password reset email and confirm that the port shows up for you?

    If not, then try registering a new account with an email you control, and check again. From your config, no port # should be added!

    (It's quite possible you changed the config file, but didn't restart NodeBB, so more users registered and got the port, since it wasn't reflected in the loaded settings)


  • @julian @a_5mith

    Thanks for stepping in guys. I just did a reinstall of nodebb and retried the activation email and finally I have the activation link url without the port.

    My configuration hasn't changed, its the same as above, but somewhere between my 3 and 5th attempt yesterday I changed the use_port option to false after reading more on the forums, and restarted nodebb with the ./nodebb restart command. I also did a couple of ./nodebb start and stops when it still didn't work.

    I think either this has to do with caching or the restart was not loading the change properly, though I would think this would be a rare thing, could be caching

    @a_5mith are you running nodebb on port 80, without that you would need to pass the nodebb port 4567 for the nginx proxy to work, wouldn't it?

    Thanks guys!

  • GNU/Linux Admin

    @raul said:

    @a_5mith are you running nodebb on port 80, without that you would need to pass the nodebb port 4567 for the nginx proxy to work, wouldn't it?

    Yes. that is correct. We pass in the port (or rather, we specify the proxy_pass value directly😞

    proxy_pass http://127.0.0.1:4567/;
    

Suggested Topics

| |