# 典型配置
location ~ \.php$ {
    root           html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
    include        fastcgi_params;
}

# 修改第1,6行,支持pathinfo

location ~ \.php(.*)$ { # 正则匹配.php后的pathinfo部分
    root html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
    fastcgi_param PATH_INFO $1; # 把pathinfo部分赋给PATH_INFO变量
    include        fastcgi_params;
}

http://www.yanshiba.com/archives/700

相关文章:

  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-11-25
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2022-01-04
  • 2022-01-17
  • 2022-12-23
  • 2022-01-02
  • 2021-10-26
  • 2022-12-23
相关资源
相似解决方案