2

2012/10/26 14:57:49 [error] 14180#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 24.0.20.48, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:81/", host: "107.20.184.144"

This is the nginx error that I get which results in a 503 error. Not sure what to do about it. connect() failed (111: Connection refused) while connecting to upstream said to use php-fpm, but I'm using Rails, so I think it's a different error. Any help would be GREATLY appreciated.

Thank you

EDIT: If it matters, this machine has Apache2 running on port 81 it seems. Not sure what that has to do with Rails though...

1 Answer 1

3

nginx is trying to pass upstream to a web server on port 81, as you configured it.

However, you probably aren't running Rails on port 81; by default thin and some other Rails web servers listen on port 3000.

Double check the port number that your Rails app is listening on, and make sure it matches what you have configured in nginx.

You also need to make sure that the upstream server is actually running. It could just be stopped.

4
  • How do I check the port that Rails is running on? I'm not too familiar with Rails, and have inherited this project
    – Shamoon
    Oct 26, 2012 at 15:33
  • What is the upstream server and how do I see if it's running?
    – Shamoon
    Oct 26, 2012 at 15:34
  • Your edit says what the upstream server is. Oct 26, 2012 at 15:46
  • Okay - so it appears that Apache2 is running on port 81, but when I hit it, I get a 503 Service Unavailable - No server is available to handle this request. error. So I guess the issue lies with Apache?
    – Shamoon
    Oct 26, 2012 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .