504 Gateway Time-out(Rails one click install)


I’ve just installed a Ruby on Rails application by following this tutorial; . But the app isn’t working, I’m getting a 504 Gateway Time-out. Can anyone point me in the right direction of fixing it?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.


Despite the fail_timeout = 0; in the upstream, NGINX relies on proxy_connect_timeout also, which is set to a default of 60s, and according to their documentation, can not generally exceed 75s.

So if proxy_connect_timeout is not set (and it’s not in that guide), it defaults to 60s. If you’re app isn’t responding in that amount of time, you’ll receive a 504 GTO error.

What this means is that when NGINX proxies the request to your app, it’s just not responding quickly enough with a valid response (i.e. 200 or other), so to resolve this, you’d need to take a look at your application and see why it’s not responding.

I’ve tested quit a few of the stock one-click images and they work as intended (the test app works), so I don’t think it’s an issue there, but most likely something within the app you’ve installed and are trying to poxy requests to.