使nginx支持pathinfo模式

在将fastadmin部署到虚拟机中时,遇到如下问题:当访问登录页面时,页面进行不断的循环跳转重定向。解决方法是将nginx配置为支持pathinfo的模式
以下是nginx中的配置内容:
location ~ \.php { #这里去掉了后面的$
        root           /var/www/html/server/public;
        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  /scripts$fastcgi_script_name;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params; 
    }

猜你喜欢

转载自www.cnblogs.com/lty-fly/p/10867715.html