配置nginx使之支持pathinfo

和以前的配置比较,主要三点变化:

        #去掉php后面的$
        location ~ \.php {
        #    root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info ^(.+\.php)(.*)$;     #增加这一句
            fastcgi_param PATH_INFO $fastcgi_path_info;    #增加这一句

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

测试成功

配置nginx使之支持pathinfo_第1张图片

你可能感兴趣的:(php)