504 Gateway Time-out nginx

Posted May 21, 2014 14.1k views
Hello, I'm trying to deploy my first Rails app but keep getting a `504 Gateway Time-out nginx` error all the time. I followed this tutorial meticulously: I already spent hours reading other (similar) tutorials as well as my various error logs. Unfortunately, I can't get any information out of those logs, so I don't know what I am missing. This would be one line from my NGINX error log (the other lines all look virtually the same): `2014/05/21 10:04:12 [error] 731#0: *216 upstream timed out (110: Connection timed out) while reading response header from upstream, client:, server: _, request: "GET / HTTP/1.1", upstream: "", host: ""` Can anybody tell me what I am doing wrong here? Thanks for any help.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
Is there anything in /home/unicorn/log/unicorn.log ?

I'd also try restarting the unicorn service if you haven't done so after deploying new code:

service unicorn restart
No, interestingly, when I try to open that file from within the `log` directory using `nano unicorn.log`, I get a blank screen in my terminal on Mac OS X for a few seconds. It then says `Killed` in my terminal. What could this mean?
And how the heck can I format code in my posts here? :-)

Same problem here =(

I already tried everything I saw on the comunity

“bundle update” worked for me!