获得网关超时Rails应用程序与Nginx + Puma在Digital Ocean上运行

时间:2015-09-30 23:05:08

标签: ruby-on-rails nginx capistrano server-sent-events puma

关注this guide我在Digital Ocean Droplet上设置我的应用程序,但它无效。该网站没有加载并且它正在抛出:"网关超时"。

Puma服务器正常工作,因为ps aux | grep puma打印:

root     15878  0.0  0.4 376832  2168 ?        Sl   12:50   0:00 puma 2.13.4 (unix:///var/www/myapp/shared/tmp/sockets/myapp-puma.sock) [20150930164940]        
root     15881  0.0  0.7 903676  3692 ?        Sl   12:50   0:06 puma: cluster worker 0: 15878 [20150930164940]                                              
root     24654  0.0  0.1  11748   916 pts/2    S+   18:00   0:00 grep --color=auto puma

我的Nginx配置:

user root;

worker_processes 1;

events {
  worker_connections 1024;
}

http {
    upstream puma {
       server unix:///var/www/myapp/shared/tmp/sockets/myapp-puma.sock;
    }

    server {
        listen       80;
        server_name myapp.com;
        root /var/www/myapp/current/public;
        access_log /var/www/myapp/current/log/access.log;
        error_log /var/www/myapp/current/log/error.log;

        try_files $uri/index.html $uri @puma;
        location @puma {
            proxy_pass http://puma;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;
        }

        client_max_body_size 10M;
        keepalive_timeout 10;
    }
}

我没有收到服务器的回复。在我error.log我有这个错误:

015/09/30 17:02:39 [error] 23840#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 77.47.218.12, server: myapp.com, request: "GET / HTTP/1.1", upstream: "http://unix:///var/www/myapp/shared/tmp/sockets/myapp-puma.sock/", host: "myapp.com"

puma.error.log为空,puma.access.log包含:

message type 0x32 arrived from server while idle
message type 0x32 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x32 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle

从主页面我的应用程序开始监听由PostgreSQL NOTIFY / LISTEN + ActionController :: Live

提供的服务器发送事件

0 个答案:

没有答案