加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

403禁止使用nginx

发布时间:2020-12-13 21:12:32 所属栏目:Nginx 来源:网络整理
导读:我正在尝试使用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

我正在尝试使用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指令中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读