这个nginx + Ruby on Rails错误是什么意思:connect()失败(111:连接被拒绝)从上游读取响应头

时间:2013-07-27 19:34:20

标签: ruby-on-rails nginx

我刚刚接手了一个使用临时应用程序和生产应用程序的Ruby on Rails项目。不幸的是,设置它的人是MIA。我运行了“部署”脚本(Capistrano)来部署到登台服务器,但它把房子搞定了

在nginx日志中,我看到:connect()失败(111:连接被拒绝),同时从上游读取响应头

不熟悉nginx。有人能告诉我这意味着什么吗?

nginx.conf

##################
# STAGING SETTINGS
    upstream staging_mongrel {
        server 127.0.0.1:8003;
        }

    server {
        listen       80;
        server_name  staging.removed.org;
        root /var/www/apps/staging/current/public;

        index  index.html index.htm;
        location / {
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect false;

            proxy_connect_timeout     90;
            proxy_send_timeout       400;
            proxy_read_timeout      3600;

            client_max_body_size     20m;

            if (-f $request_filename/index.html) {
                 rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename.html) {
                rewrite (.*) $1.html break;
            }
            if (!-f $request_filename) {
                proxy_pass http://staging_mongrel;
                break;
            }
         }
         error_page   500 502 503 504  /50x.html;
         location = /50x.html {
             root   html;
         }
    }
}

1 个答案:

答案 0 :(得分:0)

rails app停止运行。不知道为什么。事实证明我必须启动mongrel实例。