mac Nginx+CI出现404错误

主要是ci框架需要配置rewrite

nginx.conf配置文件添加:

location /wechat/ {
if (!-e $request_filename) {
rewrite ^/wechat/(.*)$ /wechat/index.php?q=$uri&$args;
}
}

注:wechat 是ci项目目录,比如你本地项目访问http://127.0.0.1/wechat/server ,修改你自己的就可以了

这里我已经设置ci框架去掉了index.php,

具体去掉index.php方法http://www.cnblogs.com/chaihy/p/8528195.html 

如有疑问请加群讨论

原文地址:https://www.cnblogs.com/chaihy/p/9052079.html