我正在尝试使用nginx创建一个localhost服务器.我的页面上有403 Forbidden.这是我的nginx错误日志:
2013/03/30 20:39:18 [error] 12161#0: *1 directory index of "/home/mike/Projects/606club/" is forbidden,client: 127.0.0.1,server: localhost,request: "GET /606club/ HTTP/1.1",host: "localhost"
我的nginx.conf文件:
server {
listen 80;
server_name localhost;
#for .html sites
location / {
root /home/mike/Projects;
index index.html index.htm;
}
#for .php sites
location ~ \.php${
root /home/mike/Projects;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /opt/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
我在以下网址的网站给出了以下内容:
作品
http://
403禁止错误
http://
我的文件夹有权限755.
最佳答案
如果您希望/index.php为/提供请求,则需要将index.php添加到index指令中.