用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2180|回复: 2
收起左侧

CI在nginx下后台404是什么原因

[复制链接]
发表于 2014-8-5 14:48:45 | 显示全部楼层 |阅读模式
项目目录是这样的file:///C:\Users\youlong\AppData\Roaming\Tencent\Users\314555630\QQ\WinTemp\RichOle\`P3KZ86]L]NNJX0ZTB(Q%~S.jpgadmin/ 后台管理
butwhy/ 前台

www/admin.php 走后台管理
www/index.php

前台访问正常,但是打开后台管理报404错误


  1. server {
  2.          listen       80;
  3.             server_name  www.abc.com;
  4.                 index index.html index.htm index.php;
  5.                 root /data/www/butwhy/www;
  6.                
  7.                
  8.                 location /index.php {
  9.                       index index.php;
  10.                       if (!-e $request_filename) {
  11.                            rewrite ^/(.*)$ /index.php?$1 last;
  12.                            break;
  13.                        }   
  14.                 }
  15.                                        
  16.                 location ~ .*\.(php|php5)?$
  17.                 {

  18.                         fastcgi_pass  127.0.0.1:9000;
  19.                         fastcgi_index index.php;
  20.                         include fastcgi.conf;               
  21.                 }


  22.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  23.                 {
  24.                         expires 30d;
  25.                 }
  26.                 location ~ .*\.(js|css)?$
  27.                 {
  28.                         expires 1h;
  29.                 }
  30.                 access_log  /alidata/log/nginx/access/butwhy.log;
  31. }


复制代码


file:///C:\Users\youlong\AppData\Roaming\Tencent\Users\314555630\QQ\WinTemp\RichOle\`P3KZ86]L]NNJX0ZTB(Q%~S.jpg


 楼主| 发表于 2014-8-5 14:53:10 | 显示全部楼层
后台的也加了路由规则还是报错
  1. location /admin.php {
  2.             index admin.php;
  3.             if (!-e $request_filename) {
  4.                 rewrite ^/(.*)$ /admin.php?$1 last;
  5.                 break;
  6.             }  
复制代码


 楼主| 发表于 2014-8-6 09:52:05 | 显示全部楼层
搞定了,
$config['uri_protocol']        = 'PATH_INFO';改成$config['uri_protocol']        = 'REQUEST_URI';

本版积分规则