mercredi 27 mai 2015

Domain name rejected by nginx

I have a server running a very simple rails app. It has nginx set up to listen on port 80, which further forwards the request to a unicorn socket file under (Rails.root)/tmp/unicorn.sock.

I bought a domain name from domain.com and pointed it to my server's address=.

e.g. Domain: mydomain.com -> Server: 110.56.45.12

Everything works great when I hit the server directly, by either visiting 110.56.45.12 in my browser or ssh-ing into the box and running curl 127.0.0.1. I assume this is because both these actions hit port 80 and nginx serves back the correct content.

However when I try to use the public domain name domain.com or I try curl localhost I get the classic "We're sorry, but something went wrong." rails page.

I checked the rails production log and there is nothing there. I then checked nginx error log at /var/log/nginx/error.log and only got

2015/05/27 07:01:24 [error] 20041#0: *143 connect() to unix:/home/jeeves/my_app/tmp/unicorn.sock failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mydomain.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/jeeves/my_app/tmp/unicorn.sock:/", host: "localhost"

Is there any reason my server is rejecting that connection?

Thanks!




Aucun commentaire:

Enregistrer un commentaire