nginx 1.9
server 里针对 php 的 伪静态 配置,这个实际使用倒是没问题
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
这是现在的 location 配置
location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
fastcgi_pass unix:/dev/shm/fpm-cgi.sock;
fastcgi_index index.php;
fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
之前的配置
location ~ ..php(\/.)*$ {
fastcgi_pass unix:/dev/shm/fpm-cgi.sock;
fastcgi_index index.php;
fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
都没有问题,可以正常运行 typecho 程序,所以 pathinfo 到底该怎么配置?