首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CGI指数收益率403 (禁止)

问CGI指数收益率403 (禁止)
EN

Stack Overflow用户
提问于 2013-04-05 09:48:18
回答 1查看 354关注 0票数 0

我在一台ubuntu电脑上用php-cgi运行nginx。事情似乎运行得很好,除了访问/的主要细节从nginx中产生了"403禁止“。访问/index.php运行得很好。如果我添加index.html并转到/,也可以。

代码语言:javascript
复制
server {
    root /home/ajcrites/projects/php/devays/public/;
    server_name sub.localhost;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

看起来fastcgi_index index.php;会涵盖这一点,但事实显然并非如此。要让/为/index.php提供服务,我需要添加什么吗

EN

回答 1

Stack Overflow用户

发布于 2013-04-07 00:29:47

您需要将index.php添加到索引指令中,以便获得类似于index index.html index.php;的内容

请参阅http://nginx.org/en/docs/http/ngx_http_index_module.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15824612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档