Nginx Unicorn Rails - 504网关超时

时间:2016-06-10 10:39:32

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

我正在使用public Panel GenerateListPanel<T>(IEnumerable<T> workflowConfiguration) { Panel panel = new Panel(); return panel; } 设置完所有内容后出现以下错误

Ruby on Rails One-Click Application on DigitalOcean

/etc/unicorn.conf

    2016/06/10 07:48:28 [error] 1702#0: *6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 106.51.23.165, server: 107.170.3.237, request
: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "107.170.3.237"
2016/06/10 07:49:45 [error] 1702#0: *6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 106.51.23.165, server: 107.170.3.237, request
: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "107.170.3.237"
2016/06/10 07:54:14 [error] 2954#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.171.105.237, server: 107.170.3.237, reque
st: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "107.170.3.237"
2016/06/10 07:58:54 [error] 3278#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.171.105.237, server: 107.170.3.237, reque
st: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "107.170.3.237"

的/ etc /默认/麒麟

listen "unix:/var/run/unicorn.sock"
#listen "/tmp/unicorn.sock"
worker_processes 4
user "rails"
working_directory "/home/rails/skreem-ror"
pid "/var/run/unicorn.pid"
stderr_path "/var/log/unicorn/unicorn.log"
stdout_path "/var/log/unicorn/unicorn.log"

的/ etc / nginx的/ /导轨启用位点-

# Change paramentres below to appropriate values and set CONFIGURED to yes.
CONFIGURED=yes

# Default timeout until child process is killed during server upgrade,
# it has *no* relation to option "timeout" in server's config.rb.
TIMEOUT=60

# Path to your web application, sh'ld be also set in server's config.rb,
# option "working_directory". Rack's config.ru is located here.
APP_ROOT=/home/rails/skreem-ror

# Server's config.rb, it's not a rack's config.ru
CONFIG_RB=/etc/unicorn.conf

# Where to store PID, sh'ld be also set in server's config.rb, option "pid".
PID=/var/run/unicorn.pid
RAILS_ENV="development"
UNICORN_OPTS="-D -c $CONFIG_RB -E $RAILS_ENV"

PATH=/usr/local/rvm/rubies/ruby-2.3.1/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-2.3.1@global/bin:/usr/local/rvm/gems/ruby-2.3.1/bin/
export GEM_HOME=/usr/local/rvm/gems/ruby-2.3.1
export GEM_PATH=/usr/local/rvm/gems/ruby-2.3.1:/usr/local/rvm/gems/ruby-2.3.1@global
DAEMON=/usr/local/rvm/gems/ruby-2.3.1/bin/unicorn

1 个答案:

答案 0 :(得分:0)

看起来您需要将gem unicorn添加到Gemfile并运行bundle install。