nginx +乘客 + Rails - 403 禁止错误
我已经安装了 Nginx 服务器并配置了所有需要的东西,但目前我遇到了 403 禁止错误。日志显示:
2010/12/28 17:38:59 [error] 28664#0: *27 directory index of "/home/appuser/test_app" is forbidden, client: xxx.xxx.xxx.xxx, server: localhost, request: "GET / HTTP/1.1", host: "xxx.xxx.xxx.xxx"
我的配置:
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.2;
passenger_ruby /usr/bin/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /home/appuser/test_app;
passenger_enabled on;
}
}
有什么解决方案吗?
I have install Nginx server and configured all needed stuff, but currently I'm having error with 403 forbidden error. Log says:
2010/12/28 17:38:59 [error] 28664#0: *27 directory index of "/home/appuser/test_app" is forbidden, client: xxx.xxx.xxx.xxx, server: localhost, request: "GET / HTTP/1.1", host: "xxx.xxx.xxx.xxx"
My config:
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.2;
passenger_ruby /usr/bin/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /home/appuser/test_app;
passenger_enabled on;
}
}
Any solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更改
为
change
to
nginx root 指令应指向应用程序的“public”目录。
The nginx root directive should point to the 'public' directory of the app.
您是否使用 rvm 来安装 Ruby?从你的道路来看,你不是。但如果是的话,您需要小心 Passenger_* 配置选项。看一下这里: Rails 3.1,nginx,禁止乘客目录索引
By any chance are you using rvm to install Ruby? Judging by your paths, you aren't. But in case you are, you need to be careful with the passenger_* configuration options. Take a look here: Rails 3.1, nginx, Passenger directory index forbidden