nginx + php-fpm 开启 PATH_INFO 模式

很多框架默认路由都是 PATH_INFO 模式,比如默认在 Apache 并且没有 rewrite 时,CodeIgniter 一般可以这样访问 /index.php/controller/action ,那么 nginx 和 php-fpm 如何设置支持 PATH_INFO 模式呢?

php.ini 中一个与 PATH_INFO 有关的设置是 cgi.fix_path 默认为 1,我们将其设置为 0。

php.ini 设置:

接下来是 nginx 配置:

原文地址:https://www.cnblogs.com/surplus/p/15340939.html