带有ruby on rails的Nginx出现了502 Bad Gateway nginx / 1.4.6(Ubuntu)错误

时间:2015-12-30 08:18:30

标签: ruby-on-rails nginx

有些时候我的服务器出现了这个错误

<html>
    <head>
        <title>502 Bad Gateway</title>
    </head>
    <body bgcolor="white">
        <center>
            <h1>502 Bad Gateway</h1>
        </center>
        <hr>
            <center>nginx/1.4.6 (Ubuntu)</center>
        </body>
    </html>
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->

重启后工作正常。我不知道为什么。在任何帮助下,我都很感激。

谢谢

这是我的Nginx配置,它与Unicorn一起运行。

user www-data;
worker_processes 10;
pid /run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;


    include /etc/nginx/mime.types;
    default_type application/octet-stream;


    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    gzip on;
    gzip_disable "msie6";

    upstream app_server { server unix:/tmp/unicorn.spui.sock fail_timeout=0; }
    upstream faye_server { server 127.0.0.1:9292 fail_timeout=0; }
        upstream seo_server  { server 127.0.0.1:8000 fail_timeout=0; }

        # CACHE
        proxy_cache_path /var/www/cache keys_zone=seo:10m;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

当我来服务器时,看到我得到的错误日志。

2507 connect() to unix:/tmp/unicorn.spui.sock failed (111: Connection refused) while connecting to upstream, client:

0 个答案:

没有答案