让nginx支持PATH_INFO

在nginx上的站点添加如下内容:
######################################################################
location ~ \.php
{
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
        include fcgi.conf;
        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 /path/$real_script_name;
        fastcgi_param SCRIPT_NAME $real_script_name;
        fastcgi_param PATH_INFO $path_info;

}
######################################################################
/path路径根据需要更改!
posted @ 2011-11-06 15:33  飞鸿无痕  阅读(140)  评论(0编辑  收藏  举报