server{标签:real,index,name,script,PATHINFO,ThinkPHP3.1,Nginx,php,fastcgi From: https://www.cnblogs.com/nocherain/p/17122898.html
listen 8156; # 监听端口(根据自己的需求更改)
server_name localhost; # 域名
root /www/php;
index index.html index.htm index.php;
location ~ .*\.php/?.*$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
}