乘客不会找到公共道路

时间:2017-05-10 05:43:27

标签: ruby-on-rails nginx passenger rbenv ubuntu-16.10

我试图设置我的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;
}

任何人都可以帮助我吗?

感谢

1 个答案:

答案 0 :(得分:1)

由于您的根目录位于/home/myapp/myapp,请更新服务器conf:

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;
}