How to change 'localhost:4567' to actual domain name!!

  • Bit late, apologies,

    server {
        listen 80;
        location / {
            allow all;
            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";
        "secret": "Probably best not to show your secret",
        "database": "redis",
        "redis": {
            "host": "",
            "port": "6379",
            "password": "Or your Database Password",
            "database": "0"
        "url": ""

    Just change for your domain. And make sure your DNS points to your servers IP address via an A name record. Or you'll be doing the above for no reason. šŸ™‚

    Also set a password in your redis.conf file with /etc/redis/. Make it long and difficult too. Just in case. Mines 52 characters. Pretty sure @Ted has his at about 499 characters.

  • Can I know whats the use of DNS then?
    I thought DNS is used to convert our domainname -> server ip?
    Why are we using reverse proxy?

    Kinda blur haha. šŸ™‚

  • GNU/Linux

    @gvimlan said:

    Why are we using reverse proxy?

    Because a NodeBB server use 4567 as default and it is bound to all of the interfaces in a host computer. You may connect to server by http://ip:4567 probably. Nginx is needed to redirect connection to your server from port to localhost:4567.

  • GNU/Linux Admin

    @gvimlan The DNS resolves your domain name (e.g. with your server IP address (e.g. The reverse proxy listens for that request (e.g. I am @gvimlan's computer, I'd like to access at please), and transparently forwards (or proxies) that request to NodeBB (e.g. Okay, is actually listening on port 4567, so I'll talk to on your behalf)

    Hopefully that made it clearer!

  • @julian
    That cleared my doubt. Thank you šŸ™‚

  • Hi
    Can I know which file to edit to configure the river proxy to listen to my server ip without the port number?
    Thank you
    I tried to google around and messed up a file called "/etc/nginx/sites-enabled/default". šŸ˜•

  • GNU/Linux Admin

    You'll probably want to create a new file so that everything is organized. I have one file per site, that makes it easy to separate different configurations all on the same server.

    $ cd /etc/nginx/sites-available
    $ nano nodebb    # paste the nginx config here
    $ cd ../sites-enabled && ln -s ../sites-available/nodebb

    The third command creates a symbolic link to the actual configuration (in sites-available/) from the folder that nginx actually checks (sites-enables/). This sort of setup comes in handy if you ever want to temporarily disable a site, just simply remove the symbolic link! šŸ™‚

  • @julian
    Thank you for helping me, mate šŸ™‚

  • @a_5mith
    Hey mate
    Is the URL necessary in the config.json if I m using mongodb?

  • Yes, you'll need it in your config file. Just replace redis with mongo phrase or use setup to generate config.json.

Suggested Topics

| |