title: I got 504-Gateway time out error
body: <p>When I open my rails app, I get a 504-Gateway timeout error.</p>
  
  <p>Result of <code>tail /var/log/nginx/error.log</code>:</p>
  
  <pre><code>upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
  2014/01/27 12:38:05 [error] 621#0: *63 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
  2014/01/27 13:05:53 [error] 621#0: *73 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
  2014/01/27 13:16:28 [error] 621#0: *77 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
  2014/01/27 13:18:49 [error] 621#0: *80 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173" 
  </code></pre>
  
  <p>Then, the content of <code>tail /home/unicorn/log/unicorn.log</code>:</p>
  
  <pre><code>* Restarting Unicorn web server unicorn                                                                                                [ OK ] 
  root@liquorexam:/home/rails# tail /home/unicorn/log/unicorn.log
  /usr/local/rvm/gems/ruby-2.0.0-p353/gems/unicorn-4.7.0/lib/unicorn    /http_server.rb:303:in `join'
  /usr/local/rvm/gems/ruby-2.0.0-p353/gems/unicorn-4.7.0/bin/unicorn:126:in `&lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `load'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `&lt;main&gt;'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  E, [2014-01-27T13:16:14.982896 #20809] ERROR -- : reaped #&lt;Process::Status: pid   
  21135 exit 1&gt; worker=0
  I, [2014-01-27T13:16:14.983194 #20809]  INFO -- : worker=0 spawning...
  I, [2014-01-27T13:16:14.988711 #21141]  INFO -- : worker=0 spawned pid=21141
  I, [2014-01-27T13:16:15.019707 #21141]  INFO -- : Refreshing Gem list
  </code></pre>