Nginx不支持pathinfo,所以得模拟一个
===============
server{
listen 80;
server_name fi.oa.com;
index index.php index.htm index.html;
root D:/phpStudy/WWW/oa/fi;
location ~ .*\.(js|jpg|JPG|jpeg|JPEG|css|bmp|gif|GIF|png|PNG)$
{
access_log off;
}
location ~ .*\.php?$
{
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
set $mefile '';
# $mefile是根目录下的文件,里面是CI框架,可以根据你的需要编辑下面这两个if语句
if ($request_uri ~* (/config/)) {set $mefile '/config';
}
if ($request_uri ~* (/fi/)) {
set $mefile '/fi';
}
if ($request_uri !~* ((^/$)|/(api|static)|s\.php|(.*(\.html|\.js|\.css|\.ico|\.txt).*)) ) {
rewrite ^/(.*)$ $mefile/index.php?$1 last;}
}