我需要部署我的 Rails 应用程序,所以我遵循了这里的所有步骤,https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04 https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04
但在教程结束时,我收到此错误 -->“502 Bad Gateway”
EDIT
现在的错误消息 --> “我们很抱歉,但出了点问题。”
但 Nginx 错误输出是相同的,我检查 puma 错误消息,但它们只是在启动和正常停止时记录。
app_directory/log 下的 Rails 日志不会产生任何输出。
puma-manager --> 我检查它工作正常
路径 ---> 我检查了三遍
Nginx error.log 输出消息:
2016/05/18 14:22:21 [crit] 1099#0: *7 connect() to unix:/home/deploy /hotel-automata/shared/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.2.105, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/home/deploy/hotel-automata/shared/sockets/puma.sock:/500.html", host: "192.168.2.170"
操作系统 -> Vmware Player、桥接网络 Ubuntu 服务器 14.0.4
红宝石版本:2.3.1
导轨版本:4.2.5.2
这是我的 /etc/nginx/sites-available/default 的 nginx 配置内容
upstream app {
# Path to Puma SOCK file, as defined previously
server unix:/home/deploy/hotel-automata/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/deploy/hotel-automata/public;
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;
}