您好,欢迎访问一九零五行业门户网

CI在ubuntu nginx下访问出现404的疑惑

这种目录结构 在nginx为什么不能访问到admin.php ?
报错404
请教下
nginx配置如下 :
也是过以下的配置,还是404,很无语。ci没有设置path_info 也没有写其他路由。很奇怪,求指点
回复讨论(解决方案) 你 php 的根没有声明吧
你 php 的根没有声明吧
你指的是nginx指定的主目录吗?这指定了的 解决方案:
location /index.php { 
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last; 
break; 
}    
}
location /admin.php { 
            index admin.php;
                if (!-e $request_filename) {
                    rewrite . /admin.php?$1 last; 
                    break; 
                }    
        }
新增了2个location 但是首页index.php省略又做不了了。很是郁闷 ci对rewrite依赖太大
其它类似信息

推荐信息