403 禁止

403 禁止

这是我的 Nginx 配置:

user pass users;

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.7;
    passenger_ruby /usr/bin/ruby;
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
      listen 80;
      server_name some.another.ru;
      root /www/public/redmine; 
      passenger_enabled on;
      rails_env development;
   }
}

以下是 Nginx 日志:

2011/06/02 12:53:57 [error] 45986#0: *1 directory index of "/www/public/redmine/" is forbidden, client: **.*.**.***, server: some.another.ru, request: "GET / HTTP/1.1", host: "some.another.ru" 
2011/06/02 12:53:59 [error] 45986#0: *1 open() "/www/public/redmine/favicon.ico" failed (2: No such file or directory), client: **.*.**.***, server: some.another.ru, request: "GET /favicon.ico HTTP/1.1", host: "some.another.ru" 

此错误的原因是什么?我该如何修复它?

答案1

您需要将root指令指向publicredmine 安装的子文件夹。 在您的例子中,您应该写root /www/public/redmine/public;而不是root /www/public/redmine;

相关内容