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

Francis Daly francis at
Mon Dec 3 20:44:44 UTC 2012

On Mon, Dec 03, 2012 at 03:29:19PM -0500, Gallitin wrote:

Hi there,

> Via SSH?  Yes I can do this.

Yes, so long as you are running curl on the same machine that nginx is
running on, it should be a valid network test.

> When I do that it says 
> HTTP/1.1 404 Not Found


> <address>Apache Server at Port 7080</address>


Ok, that suggests that there is a listener on the host:port that nginx
is trying to access. If you add "-H " to the curl
command (just after "-i "), you will more closely mimic what nginx should
be doing -- that might show you the correct content.

> No if I do:
> curl -i
> It returns the page code from that file.

I'm unsure what you mean here.

If it is "now it is all working", then that's good and the most likely
reason for the problem was that apache was not running, or was firewalled,
when you first tested and that has now been fixed.

If it is "here is a similar thing that is working, but my test case is
not", then can you provide enough of the nginx.conf to allow the test
be reproduced? Probably, that will be just the location{} block that has
the proxy_pass that is used in the request, plus the relevant upstream{}
definition if there is one, plus whatever config is in that server{}
but outside all location{}s.

(Or just include the whole nginx config.)


Francis Daly        francis at

More information about the nginx mailing list