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

Francis Daly francis at daoine.org
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

<snip>

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

<snip>

Ok, that suggests that there is a listener on the host:port that nginx
is trying to access. If you add "-H Host:demo.domain.com " 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 http://domain.com/assets/js/msgFBmodal.js
> 
> 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.)

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list