正常配置

1 location ~ \.php$ {
2         fastcgi_pass    127.0.0.1:9000;
3         fastcgi_index   index.php;
4         fastcgi_param   SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
5         include         fastcgi_params;
6 }

修改第1行,添加第5行配置,支持pathinfo

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

 

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-04
  • 2021-11-05
  • 2022-12-23
  • 2021-05-04
  • 2021-07-31
相关资源
相似解决方案