从本质上讲,我的路线运行良好,Passenger 似乎正在加载 - 一切都是笨拙的。除了没有任何 Railsy 发生。这是我从启动服务器到第一个请求的 Nginx 日志(忽略不同的域/路由 - 这是因为我还没有移动新域,并且它返回 403 错误,因为公共文件夹中没有索引文件):
[ pid=24559 file=ext/nginx/HelperServer.cpp:826 time=2009-11-10 00:49:13.227 ]:
Passenger helper server started on PID 24559
[ pid=24559 file=ext/nginx/HelperServer.cpp:831 time=2009-11-10 00:49:13.227 ]:
Password received.
2009/11/10 00:49:53 [error] 24578#0: *1 directory index of "/var/www/***/current/public/" is forbidden, client: 188.221.195.27, server: ***, request: "GET / HTTP/1.1", host: "***"
2009/11/10 00:49:54 [error] 24578#0: *1 open() "/var/www/***/current/public/favicon.ico" failed (2: No such file or directory), client: 188.221.195.27, server: ***, request: "GET /favicon.ico HTTP/1.1", host: "***", referrer: "***"
RubyOnRails IRC 频道上有人建议这可能是网络服务器权限问题。我怀疑这可能是文件系统权限问题,但 Nginx 以 www-data 身份运行,Passenger 以 root 身份运行。
我可以从公共目录中加载静态文件,但没有启动 Rails 应用程序。有人有想法吗?我的头正在逐渐融化,弄清楚这一点!
编辑:这是虚拟主机文件:
server {
listen 80;
server_name ***;
passenger_enabled on;
location / {
root /var/www/***/current/public;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}