|  | 
 
| 好久没有来CI了,看见nginx讨论中有很多人在nginx下不会部署CI程序,实现url优化(去掉index.php),好吧,我已经在nginx使用CI有一段时间了,就来部署吧 这是nginx其中一个server的配置
 server
 {
 listen       82;
 server_name  _;  ##这个“_”其实没有什么,你也可以填*,它其实是一个域名的访问匹配正则
 index index.html index.htm index.php;
 root  /wwwroot;
 location ~ /(images|css|js|swf|upload|kindeditor)/.*$
 {
 }
 
 location ~ .*\.(txt|ico)$
 {
 }
 
 location ~ .*$
 {
 rewrite /.* /index.php break;
 fastcgi_pass  127.0.0.1:9000;
 fastcgi_index index.php;
 include fastcgi.conf;
 }
 access_log off;
 }
 
 
 在CI中config.php设置如下就可了,
 $config['base_url']        = '';
 $config['index_page'] = '';
 
 另外注意是,要将82这个端口在防火墙中打开,重启nginx就可以了
 
 | 
 |