2015-05-14 111 views
0

我正在部署nginx和獨角獸的導軌應用程序,並獲得502糟糕的getway。nginx 502部署後導軌壞網關

有人可以幫我解決這個問題嗎?非常感謝您

我的Nginx的錯誤日誌(/var/log/nginx/error.log)表示:

2015/05/14 00:26:22 [crit] 24642#0: *13 connect() to unix:/tmp/unicorn.easysign.sock failed (2: No such file or directory) while connecting to upstream, client: 89.100.32.54, server: localhost, request: "GET /easysign HTTP/1.1", upstream: "http://unix:/tmp/unicorn.easysign.sock:/500.html", host: "mysite.com" 

/etc/nginx/conf.d/default.conf:

upstream app { 
    # Path to Unicorn SOCK file, as defined previously 
    server unix:/tmp/unicorn.easysign.sock fail_timeout=0; 
} 

server { 
    listen 80; 
    server_name localhost; 

    root /var/www/mysite.com/public_html/easysign; 

    try_files $uri/index.html $uri @app; 

    location @app { 
     proxy_pass http://app; 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header Host $http_host; 
     proxy_redirect off; 
    } 

    error_page 500 502 503 504 /500.html; 
    client_max_body_size 4G; 
    keepalive_timeout 10; 
} 

/無功/網絡/ [應用名稱] /config/unicorn.rb:

root = "/var/www/mysite.com/public_html/" 
working_directory root 
pid "#{root}/tmp/pids/unicorn.pid" 
stderr_path "#{root}/log/unicorn.log" 
stdout_path "#{root}/log/unicorn.log" 

listen "/tmp/unicorn.easysign.sock" 
worker_processes 1 
timeout 30 

回答

1

請嘗試將路徑改爲套接字(例如)爲「/var/www/sockets/unicorn.easysign.sock」。不要忘記創建「/ var/www/sockets」目錄。也許有權限問題?