504 Gateway Time-out(Rails one click install)

February 24, 2017 1.8k views
Ruby on Rails One-Click Install Apps


I’ve just installed a Ruby on Rails application by following this tutorial; https://www.digitalocean.com/community/tutorials/how-to-use-the-ruby-on-rails-one-click-application-on-digitalocean . 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?

1 Answer


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.

Have another answer? Share your knowledge.