"Connection has been lost" error after update to v1.4.4

Technical Support
  • #14

    I changed as your suggest. The problem was gone.

    Thank you.

  • #15

    @PitaJ Hi PitaJ, I am also experiencing this issue. I tried as you suggested and I have tried it by removing the port number at the end of the url. Still it tells me that the connection has been lost.

    Is this issue resolved in v1.4.6?

    I will try and update it and report back.

  • Global Moderator Plugin & Theme Dev

    @teh_g post your config.json and Nginx config, please. Redact any URLs with example.com if you must.

  • #17

    @PitaJ ROFL... I feel like an idiot... I missed the .com part in the config.json. My bad, sorry for wasting your time

  • #18

    @PitaJ , is an IP address something that can be used as the URL?

    My original config.json file used http://localhost:4567, but to test access from external hosts, I tried using the IP address of the nodebb server. As others above have found, this doesn't work because the URLs must match.

    How then can I configure the config.json file to use an IP address, temporarily? This is only for internal testing, so I'm not using a webserver or proxy yet.

    My goal is to use my nodebb server IP address as the URL value and navigate to that from other hosts.

    However, when I try to use the IP address, both the Nodebb server and other hosts receive the connection lost error message.


    "url": "",
    "secret": "NULL",
    "database": "mongo",
    "mongo": {
    "host": "",
    "port": "27017",
    "username": "nodebb",
    "password": "NULL",
    "database": "nodebb"

  • Global Moderator Plugin & Theme Dev

    @Alex-Fiala yes you should be able to use IP addresses. However, you still need to have the protocol in there (http://). Copy the address at which you access your NodeBB server and paste it into the config.json

  • #20

    Archeology level up, I know, I'm sorry

    I get the same problem with the forum configured to be accessible via a subfolder. It is a fresh installation

    HTTP is fine (the forum loads fine) but WebSocket is not ("Looks like your connection to NodeBB was lost, please wait while we try to reconnect." message in the bottom right corner)

    If I start the forum in development mode, everything runs fine (both HTTP and WS)

    Nginx version: 1.10.3
    NodeJS version: 8.6.0
    NodeBB version: 1.6.0

    nginx configuration

    server {
    	listen 80;
    	listen [::]:80;
    	server_name example.com;
    	return 302 https://$server_name$request_uri;
    server {
    	listen 443 ssl;
    	listen [::]:443 ssl;
    	server_name example.com;
    	index index.html;
    	root /var/www/html/example;
    	ssl_certificate /etc/letsencrypt/live/example.com/cert.pem;
    	ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    	location / {
    		try_files $uri $uri/ =404;
    	location /forum/ {
    		proxy_set_header X-Real-IP $remote_addr;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_set_header X-Forwarded-Proto $scheme;
    		proxy_set_header Host $http_host;
    		proxy_pass http://localhost:4567;
    		proxy_redirect off;
    		proxy_http_version 1.1;
    		proxy_set_header Upgrade $http_upgrade;
    		proxy_set_header Connection "upgrade";


        "url": "https://example.com/forum/",
        "secret": -not shown-,
        "database": "mongo",
        "mongo": {-not shown-},
        "bind_address": ""

    NodeBB logs

    6/10 15:12:55 [5514] - info: Initializing NodeBB v1.6.0 https://example.com/forum/
    6/10 15:12:56 [5514] - info: [socket.io] Restricting access to origin: https://example.com:*
    6/10 15:12:57 [5514] - info: Routes added
    6/10 15:12:57 [5514] - info: NodeBB Ready
    6/10 15:12:57 [5514] - info: Enabling 'trust proxy'
    6/10 15:12:57 [5514] - info: NodeBB is now listening on:

    nginx access log:

    my.ip.v4.address - - [06/Oct/2017:15:27:55 +0200] "GET /forum/socket.io/?EIO=3&transport=polling&t=LxntlbI HTTP/1.1" 403 43 "https://example.com/forum/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"

    nginx error.log:

    2017/10/06 15:12:55 [error] 4221#4221: *494 connect() failed (111: Connection refused) while connecting to upstream, client: my.ip.v4.address, server: example.com, request: "GET /forum/socket.io/?EIO=3&transport=polling&t=LxnqJud HTTP/1.1", upstream: "", host: "example.com", referrer: "https://example.com/forum/"
  • GNU/Linux

    Can you try removing the trailing / in url in config.json?

  • #22

    Didn't work

    config.json updated:
    "url": "https://example.com/forum"

  • GNU/Linux

    Also the trailing slash in location /forum/? A mix of both?

Suggested Topics

| | | |