将server配置为以下内容,则支持pathinfo方式访问。
server {
listen 8091;
server_name localhost;
root /Users/choumin/xxx/tp6/public;
index index.html index.htm index.php;
location ~* ^.+\.(jpg|jpeg|gif|png|swf|rar|zip|css|js)$ {
root /Users/choumin/xxx/tp6/public;
index index.html index.htm;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
location ~ \.php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}