【问题标题】:I got 504-Gateway time out error我收到 504-Gateway 超时错误
【发布时间】:2014-01-27 13:38:28
【问题描述】:

当我打开我的 rails 应用程序时,我收到 504-Gateway 超时错误。

tail /var/log/nginx/error.log 的结果:

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" 

那么,tail /home/unicorn/log/unicorn.log的内容:

* 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 `<top (required)>'
/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 `<main>'
/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 `<main>'
E, [2014-01-27T13:16:14.982896 #20809] ERROR -- : reaped #<Process::Status: pid   
21135 exit 1> 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

【问题讨论】:

    标签: ruby-on-rails-3 nginx unicorn digital-ocean


    【解决方案1】:

    您的后端 unicorn 工作进程正在崩溃,但您只包括堆栈跟踪的底部部分。 unicorn.log 文件中的完整堆栈跟踪将向您显示应用程序代码中的崩溃问题。我猜是中间件不好或响应格式错误。

    【讨论】:

      猜你喜欢
      • 2015-10-20
      • 2021-05-12
      • 2012-06-04
      • 2011-04-08
      • 2014-09-30
      • 2017-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多