Solution “111 Connection refused while connecting to upstream”

Once I noticed an error in the /var/log/nginx/error.log:

[error] 29461#29461: *1 connect() failed (111: Connection refused) while connecting to upstream, client:, server: _, request: "GET /iredadmin/ HTTP/2.0", upstream: "uwsgi://", host: ""

The client tried to open iredadmin, which did not open in the browser.

In the config /etc/nginx/templates/iredadmin.tmpl I found:

include uwsgi_params;
    uwsgi_param UWSGI_CHDIR /opt/www/iredadmin;
    uwsgi_param UWSGI_SCRIPT iredadmin;
    uwsgi_param SCRIPT_NAME /iredadmin;

Check if something works on port 7791 (should be LISTEN):

netstat -na | grep LISTEN | grep 587

It turned out that nothing was running on this port, so I determined that to solve this problem, you just need to start the iredadmin service:

sudo service iredadmin start

After that, the error disappeared and iredadmin opened in the browser.

See also my articles:
Install and configure Nginx
Installing and configuring iRedMail

Leave a comment

Leave a Reply