lnmp pathinfo问题
location / {
if
(!-e
$request_filename
) {
rewrite ^/(.*)$ /index.php/
$1
last;
break
;
}
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
//这里不用担心你的服务器的ip是否和这个不一样,不用怀疑,
//这样写就行了
fastcgi_index index.php;
include
fcgi.conf;
set
$script
$fastcgi_script_name
;
if
(
$fastcgi_script_name
~
"^(.+?\.php)(/.+)$"
) {
//上行的if和“(”间要有空格,这是lunix的语法,不然会报错
//报位置变量
set
$script
$1
;
//注意这里是1234的1不是字母l
set
$path_info
$2
;
}
fastcgi_param SCRIPT_FILENAME
$document_root
$script
;
fastcgi_param SCRIPT_NAME
$script
;
fastcgi_param PATH_INFO
$path_info
;
}
Try