location ~ \.php {
# try_files $uri =404;
fastcgi_index /index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
主要是 include 下面的几行哦 .
天蓬老师2017-05-16 17:21:19
Nginx 自身没有自动产生 PATH_INFO 的功能,这就让一些通过 $_SERVER['PATH_INFO'] 来进行调度的框架不能正常进行路由调度。而 include 之下的这段代码,就是进行 PATH_INFO 的侦测,并写入到 Server 参数中传给 PHP。