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. Python3 函数注解

    Python3提供一种语法,用于为函数声明中的参数和返回值附加元数据.下面的例子是注解后的版本,特点在第一行: 1 def clip(text : str, max_len : 'int > 0 ...

  2. 封装sqlhelper【一】

    控件信息展示: //定义调用数据库类文件 namespace SqlHelper { public class TblClass { public int classId { get; set; } ...

  3. LRN(local response normalization--局部响应标准化)

    LRN全称为Local Response Normalization,即局部响应归一化层,LRN函数类似DROPOUT和数据增强作为relu激励之后防止数据过拟合而提出的一种处理方法.这个函数很少使用 ...

  4. 让browserify接收命令行参数,在打包时parse yml配置文件

    功能需求: 1用browserify把各种js打包成浏览器端的1个bundle.js,含有yml配置文件 约束: 1 yml配置文件不在当前工程里(现在还不知道放哪里,以后也会变),希望在打包时,用命 ...

  5. 算法笔记--单调队列优化dp

    单调队列:队列中元素单调递增或递减,可以用双端队列实现(deque),队列的前面和后面都可以入队出队. 单调队列优化dp: 问题引入: dp[i] = min( a[j] ) ,i-m < j ...

  6. JFinal3.0 sql管理与动态生成

    原文: 本节学习目标主要是使用JFinal中自带的Template Engin来实现对sql的管理.JFinal中为sql管理提供了3个指令#sql.#para.#namespace,来增强sql功能 ...

  7. tstringlist详细用法

    TStringList 类是在Delphi使用最厂的一个对像,我们这里一起来看看 TStringList 的详细用法. 先把要讨论的几个属性列出来:1.CommaText2.Delimiter &am ...

  8. java异常:java.lang.NullPointerException

    /** * 功能:空指针异常测试 */ /* Object[] parameters1=null; if(parameters1.length>0&&parameters1!=n ...

  9. Shell脚本管理

    sh test.sh../test.sh与source test.sh.. test.sh执行命令的区别:sh是启用子shell执行而source或点是在当前窗口执行export A=123:定义全局 ...

  10. 请问WCF 跟 WebService之间的相同跟异同

    https://social.msdn.microsoft.com/Forums/zh-CN/c06420d1-69ba-4aa6-abe5-242e3213b68f/wcf-webservice W ...