【问题标题】:Nginx configuration is not starting a rails serverNginx 配置未启动 rails 服务器
【发布时间】:2016-03-31 11:12:40
【问题描述】:

我正在尝试配置亚马逊 EC2。 Ubuntu 14.04。我在 nginx access.log 上收到此消息

2015/12/25 11:19:24 [error] 4403#0: *1 connect() to unix:/home/ubuntu/apptest/shared/puma.sock failed (111: Connection refused) while connecting to upstream, client: 109.67.134.46, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/apptest/shared/puma.sock:/", host: "54.174.110.190"

My /etc/nginx/sites-enabled/apptest.conf

upstream apptest {
    # Path to Puma SOCK file, as defined previously
    server unix:/home/ubuntu/apptest/shared/puma.sock fail_timeout=0;
}

server {
    listen 80;
    server_name localhost;

    root /home/ubuntu/apptest/current/public;

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

    location @apptest {
        proxy_pass http://apptest;
        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;
}

但是当我在服务器中运行**bundle exec puma -e production -b unix:///home/ubuntu/apptest/shared/puma.sock**

[4328] Puma 以集群模式启动...

[4328] * 版本 2.15.3 (ruby 2.2.1-p85),代号:Autumn Arbor 喷枪

[4328] * 最小线程:1,最大线程:6

[4328] * 环境:生产

[4328] * 流程工人:1

[4328] * 分阶段重启可用

[4328] * 在 unix:///home/ubuntu/apptest/shared/puma.sock 上监听

网站加载。有什么建议吗?

【问题讨论】:

    标签: ruby-on-rails ruby unix ubuntu nginx


    【解决方案1】:

    AFAIK Puma 不会被 Nginx 自动启动。它必须自己启动。彪马官方repository中有一些有用的脚本。

    【讨论】:

    • 太棒了。这正是我想要的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-19
    • 2013-10-15
    • 1970-01-01
    • 1970-01-01
    • 2013-05-31
    • 1970-01-01
    • 2017-05-12
    相关资源
    最近更新 更多