ct38 发表于 2016-12-25 12:39:08

codeigniter在nginx下正常访问

环境


[*]codeigniter2.1    nginx1.5.2

配置


[*]打开codeignite的config.php文件修改如下:

$config['uri_protocol']= "PATH_INFO";

[*] 打开nginx.conf文件修改如下:
[*]
server {
listen80;
server_nameexample.koolbao.com;
root   E:/wnmp/www/example_koolbao;
#access_log/www/access_ example1.logmain;
location / {
indexindex.php index.html index.htm;
#autoindex on;#如果文件不存在列出目录结构;
}
error_page   500 502 503 504/50x.html;
location = /50x.html {
root   /usr/share/nginx/html;
}
location ~ \.php {
fastcgi_pass   127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param   PATH_INFO $fastcgi_path_info;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
include      fastcgi_params;
}

if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
location ~ /\.ht {
denyall;
}
}
 好了,见证奇迹的时刻到了。

 
页: [1]
查看完整版本: codeigniter在nginx下正常访问