codeigniter框架需要path_info的支持,Apache默认支持path_info,但是nginx默认不支持,我们需要设置nginx,使得nginx支持path_info

网上试了好多方法最总才解决希望对大家有所帮助:(我的mac版的,具体设置看你们的需要,把重点的红色显示)

server {

listen       8080;

server_name  localhost;

location / {

# root   /usr/local/var/www/;

# index  index.html index.htm index.php;

if (-f $request_filename) {

expires max;

break;

}

if (!-e $request_filename) {

rewrite ^(.*)$ /wechat/index.php?$1 last;

break;

# rewrite ^/(.*)$ /wechat/index.php/$1 last;

# break;          注意:网上好多是用 index.php/$1 应该是 ? 这个要注意了

}

}

# error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   /usr/local/var/www;

}

location ~ \.php$ {

root           /usr/local/var/www;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

location ~ /\.ht {

deny  all;

}

}

rewrite or internal redirection cycle while processing "/wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php//wechat/index.php/server", client: 127.0.0.1, server: localhost, request: "GET /wechat/index.php/server HTTP/1.1", host: "127.0.0.1:8080"

rewrite 重复了10次 并不是 break 的问题

这个问题就是上面说的 / 改为 ? 即可。

codeigniter在nginx下返回404 not found的更多相关文章

  1. codeigniter(ci)在nginx下返回404的处理方法即codeigniter在nginx下配置方法

    codeigniter(ci)在nginx下返回404的处理方法即codeigniter在nginx下配置方法 进入nginx的配置文件 加上一句(本来就有这句,只需要修改一下就行了) locatio ...

  2. CodeIgniter框架——nginx下的配置

    odeigniter(CI)是一个轻量型的PHP优秀框架,但是它是在apache服务器下开发的,在nginx下需要特别的配置才可以使用. 对nginx的配置如下: server { listen 80 ...

  3. NGINX下配置404错误页面的方法分享

    NGINX下配置自定义的404页面是可行的,而且很简单,只需如下几步,需要的朋友可以参考下   1. 创建自己的404.html页面 2.更改nginx.conf在http定义区域加入: fastcg ...

  4. codeigniter在nginx 下支持pathinfo和去除index.php的方法

    as今天准备把网站搬迁到nginx上发现codeigniter框架在nginx上不能使用,后来发现是nginx不支持pathinfo,下面介绍怎么在nginx下开启pathinfo 开始pathinf ...

  5. CodeIgniter在nginx下404 not found

    server { listen ; server_name test.platform; charset utf8; root /data/www/platform/trunk; location / ...

  6. nginx下配置404错误页面

    1.创建自己的404.html页面,并放于网站根目录. 2.更改nginx.conf在http定义区域加入: fastcgi_intercept_errors on; 3.更改nginx.conf(或 ...

  7. tp5在apache下能访问,但放到nginx下报404

    index index.php index.html index.htm; if ( -f $request_filename) { break; } if ( !-e $request_filena ...

  8. nginx history路由模式时,页面返回404重定向index.html

    1.路由默认是带#的,有时我们感觉不美观,就使其变为history模式,也就没有#字符 2.# 如果找不到当前页面(404),就返回index.html,重新分配路由 location ^~/prod ...

  9. 记录一次 Nginx 配置 proxy_pass 后 返回404问题

    一. Nginx 配置 proxy_pass 后 返回404问题 故障解决和定位 1.1. 问题 在一次生产涉及多次转发的配置中, 需求是下面的图: 在配置好了 proxy_pass 之后,请求 ww ...

随机推荐

  1. php格式化数字输出number_format

    <?php $num = 4999.944444; $formattedNum = number_format($num).PHP_EOL; echo $formattedNum; $forma ...

  2. PHP直接将文件流转换为字符串

    有时候不需要图片直接输出到浏览器,需要如下处理! 输出到浏览器 $qrCode = new QrCode(); $qrCode ->setText('Life is too short to b ...

  3. Java的CountDownLatch和CyclicBarrier的理解和区别

    CountDownLatch和CyclicBarrier的功能看起来很相似,不易区分,有一种谜之的神秘.本文将通过通俗的例子并结合代码讲解两者的使用方法和区别. CountDownLatch和Cycl ...

  4. <script src="../build/browser.min.js"></script> 是用来里面babel工具把ES6的语法转成ES5

    <!DOCTYPE html> <html> <head> <script src="../build/react.js">< ...

  5. 力扣(LeetCode)520. 检测大写字母

    给定一个单词,你需要判断单词的大写使用是否正确. 我们定义,在以下情况时,单词的大写用法是正确的: 全部字母都是大写,比如"USA". 单词中所有字母都不是大写,比如"l ...

  6. MySQL processlist/kill

    1.show full processlist 显示MySQL所有正在执行的进程,用于查看当前的MySQL运行情况,避免死锁等导致的异常情况. 主要的列: Id:进程Id User:登录账号 Host ...

  7. spring cloud: Hystrix(七):Hystrix的断容器监控dashboard

    Hystrix的断容器监控dashboard. dashboard是用来监控Hystrix的断容器监控的,图形化dashboard是如何实现指标的收集展示的. dashboard 本地端口8730 项 ...

  8. WPF经典编程模式-MVVM示例讲解

    https://www.cnblogs.com/lvdongjie/p/5515962.html

  9. 京东某商品页面的简单爬取 --Pyhon网络爬虫与信息获取

    1.京东商品页面链接地址(本次要爬取的页面url) https://item.jd.hk/1953999200.html 2.代码部分 import requestsurl = "https ...

  10. Java方法重载的区分

    测试程序代码: class Computer { private int x; public Computer(){ this(10); } /** * 构造方法重载 * @param x */ pu ...