[英]nginx + passenger + rails - 403 forbidden error
I have install Nginx server and configured all needed stuff, but currently I'm having error with 403 forbidden error. 我已经安装了Nginx服务器并配置了所有需要的东西,但是目前我遇到了403 forbidden错误的错误。 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? 有解决方案吗
change 更改
/home/appuser/test_app
to 至
/home/appuser/test_app/public
nginx root指令应指向应用程序的“public”目录。
By any chance are you using rvm to install Ruby? 你有没有机会使用rvm来安装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
看看这里: Rails 3.1,nginx,禁止使用目录索引
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.