zoukankan      html  css  js  c++  java
  • Nginx服务器不支持PATH_INFO的问题及解决办法

    在ThinkPHP5中  发现URL 不支持典型模式访问  http://serverName/index.php(或者其它应用入口文件)/模块/控制器/操作/[参数名/参数值...]

    因为默认nginx不支持PATHINFO 只能通过http://serverName/index.php(或者其它应用入口文件)?s=/模块/控制器/操作/[参数名/参数值...]

    感觉好烦哦 于是就想办法修改配置

    location ~ .php$ { //$代表结尾,这样对于后面跟随内容的URL地址就不会进行解析
         fastcgi_index index.php;
         fastcgi_pass 127.0.0.1:9000;
         include fastcgi_params;
    }

    上面的配置Nginx是不会正交给php cgi服务器的. 所以我们需要改写这段配置为:

    location ~ .php {
         fastcgi_index index.php;
       fastcgi_split_path_info ^(.+.php)(.*)$; #增加这一句
    fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句 fastcgi_pass 127.0.0.1:9000; include fastcgi_params; }
  • 相关阅读:
    DHCP服务搭建
    JumpServer跳板机
    PXE
    DNS
    MySQL
    企业级LNMP分离式部署
    MHA-Atlas-MySQL高可用集群2
    MHA-Atlas-MySQL高可用集群
    备份全网服务器数据
    FTP
  • 原文地址:https://www.cnblogs.com/phpwyl/p/10482300.html
Copyright © 2011-2022 走看看