|
location ~ .*\.php {
root /NPMserv/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
rewrite ^/index.php/(.*)$ /index.php?$1 last;
}
fastcgi_param SCRIPT_FILENAME /NPMserv/www$fastcgi_script_name;
include fastcgi_params;
}
这里注意两个地方,第一个就是location ~ .*\.php后面不要带其它字符
第二个,加一个rewrite把/转化为?
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
rewrite ^/index.php/(.*)$ /index.php?$1 last;
}
明白?上面我都加了蓝色 |
|