Below you will find pages that utilize the taxonomy term “pathinfo”
October 8, 2010
nginx配置支持php的pathinfo模式配置方法
"nginx模式不支持pathinfo模式,类似info.php/hello形式的url会被提示找不到页面。下面的通过正则找出实际文件路径和pathinfo部分的方法,让nginx支持pathinfo。\nlocation ~ \\.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; ##通过设置模拟出pathinfo set $path_info “”; 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 …"