connect() failed (111: Connection refused) while connecting to upstream



  • I'm about to die searching for solution ... 😞
    My site dealslama.com is showing error, try open it and you can see it,
    NGINX error log is showing
    connect() failed (111: Connection refused) while connecting to upstream

    I tried :

    • list itemTCP /IP connection in www.conf and vHosts files

    • I tried php5-fpm.sock but this too failed.

    What to do now ?


  • Global Moderator

    What is your nginx config? What is your NodeBB config? Feel free to remove any private information.



  • I have the same issue, here is what Im using
    Ubuntu 16.04,
    nginx/1.10.0
    node v6.9.4

    Config files:

    server {
        listen 80;
        listen [::]:80;
        server_name minnotes.mzlabs.net;
    
        location / {
            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_set_header X-NginX-Proxy true;
            proxy_pass http://localhost:4567;
            proxy_redirect off;
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    For Config file im using

    {
        "url": "http://localhost:4567",
        "secret": "7ab49b85-e...",
        "database": "redis",
        "redis": {
                "host": "127.0.0.1",
                "port": "6379",
                "password": "...",
                "database": "1"
        }
    }
    

    Also when I start it using node app.js, one of the lines says:

     14/3 15:11:55 [12013] - info: [socket.io] Restricting access to origin: http://localhost:*
    

    Error i getting

    2017/03/14 15:18:19 [error] 1416#1416: *89 connect() failed (111: Connection refused) while connecting to upstream, client: 50.23.111.246, server: minnotes.mzlabs.net, request: "GET /socket.io/?EIO=3&transport=polling&t=LhDPWjZ HTTP/1.1", upstream: "http://[::1]:4567/socket.io/?EIO=3&transport=polling&t=LhDPWjZ", host: "minnotes.mzlabs.net", referrer: "http://minnotes.mzlabs.net/"
    

    Any ideas?


  • Global Moderator

    @Mike-Z change the url in your config file to the actual url of your forum.



  • Thanks for the reply, I spend few hours looking into it, and the solutions was this simple. Thanks.


 

| |