0

我正在尝试设置我的 Rails 服务器,但乘客无法识别我的应用程序,并在日志中显示此错误:

[error] 1473#1473: *1 "/home/myapp/public/index.html" is not found (2: No such file or directory)

或客户端出现 404 错误。

我已经完成了所有故障排除可能性来解决,但没有。

这是我的服务器块:

server {
    listen 80;
    server_name mydomaiin.com;
    rails_env development;

   # Turn on Passenger
   passenger_enabled on;
   passenger_ruby /home/myapp/.rbenv/versions/2.4.0/bin/ruby;

   # Tell Nginx and Passenger where your app's 'public' directory is
   root /home/myapp/public;
}

谁能帮我?

谢谢

4

1 回答 1

1

当您的根目录位于 中时/home/myapp/myapp,请更新您的服务器配置:

server {
    listen 80;
    server_name mydomaiin.com;
    rails_env development;

   # Turn on Passenger
   passenger_enabled on;
   passenger_ruby /home/myapp/.rbenv/versions/2.4.0/bin/ruby;

   # Tell Nginx and Passenger where your app's 'public' directory is
   root /home/myapp/myapp/public;
}
于 2017-05-10T06:05:00.450 回答