lnmp化境开启pathinfo,支持tp5.0等访问

 一、 开启pathinfo  

#注释 下面这一行 
#include enable-php.conf
#载入新的配置文件
include  enable-php-pathinfo.conf

#添加如下
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }
        }
        location ~ /index.php {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
            include        fastcgi_params;
            fastcgi_param APPLICATION_ENV dev;
        }

 开始在网上搜了一大堆, 不好使, 后来找到了这个, 亲测有效, 保存以方便查找

猜你喜欢

转载自www.cnblogs.com/wuwenshuai/p/8980012.html