111: Connection Refused

I'm getting the following error in my Flask app:

 [error] 689#689: *13965 connect() failed (111: Connection refused) while connecting to upstream,

I'm having trouble diagnosing the root cause of this. Any suggestions on what to look for?

4 Replies

Hey there,

I'm not all that familiar with Flask, but I'll try to help out nonetheless.

From what I've discovered through my research into this for you, this error is apparently caused on the backend for Nginx. I found a post on Stack Exchange that describes this, and it turns out the user didn't have PHP-FPM installed. I don't know if this is the solution to your particular situation, because I'm not familiar with how you have things set up, but I figured it was worth passing along to you:

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

If this isn't the solution, perhaps another one of our Flask users will have some input. I'll toss some tags on this post to give it some extra visibility.

I was getting [error] 955#955: on a Django app, it turn out i havent pip installed a python package.
I Install it then:
sudo systemctl daemon-reload
sudo systemctl restart gunicorn
sudo systemctl restart nginx

And it works.

Hope this helps you out.

ssh: connect to host port 22: Connection refused
i am getting this error


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct