部署的Rails应用程序仍然看到nginx启动页面

时间:2016-04-23 08:56:01

标签: ruby-on-rails nginx deployment digital-ocean

我刚刚设置了我的第一个数字海洋VPS,并按照本指南设法部署了我的Rails应用:https://gorails.com/deploy/ubuntu/14.04

Unfortunatley我仍然看到nginx启动页面,并且你们可以帮我解决这个问题吗?

在nginx错误日志中,我看到了:

  

[2016-04-20 14:48:15.4541 31875 / 7f70762f57c0 age / Ust / UstRouterMain.cpp:342]:乘客UstRouter在线,PID 31875   2016/04/21 14:58:58 [emerg] 1721#0:/etc/nginx/sites-enabled/default.save:27中不允许使用“listen”指令

我的nginx conf看起来像:

server {
        listen 80 default_server;
        server_name dev.myapp.co.uk;
        passenger_enabled on;
        rails_env production;
        root /home/deploy/myapp/current/public;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
}

我显然已根据需要将“myapp”更改为正确的域名和应用名称。

有什么想法吗?

1 个答案:

答案 0 :(得分:4)

问题似乎是/etc/nginx/sites-enabled/中有两个nginx配置文件,并且它们都有相同的listen 80 default_server;行。