[Solved] NodeBB does not work on the port 80 - Nginx



  • Hello,

    • VPS Ubuntu - Nginx + mongo

    • Config.json

    {
    "base_url": "http://monnomdedomaine.eu",
    "port": "4569",
    "use_port": true,
    "secret": "XXXX-XXX-XXX-XXXXXXXXXXXX",
    "bind_address": "185.xx.xx.xx6",(VPS IP)
    "database": "mongo",
    "mongo": { "host": "127.0.0.1", "port": "27017", "username": "", "password": "", "database": "0"
    },
    "bcrypt_rounds": 12,
    "upload_path": "/public/uploads",
    "relative_path": ""
    }

    • /etc/ngninx/sites-enable/monnomdedomaine

    server {
    listen 80;
    server_name www.monnomdedomaine.eu monnomdedomaine.eu;
    location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://185.xx.xx.xx6:4569; (VPS IP)
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }}

    • Resultat port 80:
      I can connect, the icon appears admin, but register and login don't change with user info, and I can't change anything in admin, 0 socket connections.
      same result with "bind_address" and "proxy_pass" 127.0.0.1

    • Resultat port 4569
      I can use fully nodeBB (in admin 1 socket active)

    Do you know where the problem might be?

    (Info: I begin with nginx, node and my english is bad - french)



  • @neocorp

    I think you're missing the path reference in your Nginx config:

    root /path/to/nodebb/root/;
    

    Also, you might want to change the base_url in config.json to http:// 127.0.0.1 and modify proxy_pass to match.



    • config.json

    {
    "base_url": "http://www.monnomdedomaine.eu",
    "port": "4569",
    "use_port": true,
    "secret": "xxx-xxx-xxx-xx-xxx",
    "bind_address": "127.0.0.1",
    "database": "mongo",
    "mongo": {
    "host": "127.0.0.1",
    "port": "27017",
    "username": "",
    "password": "",
    "database": "0"
    },
    "bcrypt_rounds": 12,
    "upload_path": "/public/uploads",
    "relative_path": ""
    }

    • config nginx

    server {
    listen 80;
    server_name www.monnomdedomaine.eu monnomdedomaine.eu;
    location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-NginX-Proxy true;
    root /website/monnomdedomaine/nodebb/;
    proxy_pass http://127.0.0.1:4569;
    proxy_redirect off;
    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }
    }

    Same problem 😞
    nodebb_problem.jpg


  • GNU/Linux Admin

    @planner No need for the root directive for NodeBB, just fyi 🙂

    @neocorp Please let me know your nginx version, I believe you may be out of date. It must be greater than (or equal to) v1.3.13



  • Please let me know your nginx version, I believe you may be out of date. It must be greater than (or equal to) v1.3.13

    YES!
    I have upgrade nginx version 1.1.19 to 1.4.6 and "It's work" 😛

    Thanks!


  • GNU/Linux Admin

    Awesome, glad we got that figured out 🙂


Log in to reply
 

Suggested Topics

| |