nginx 配置如下
location / {
	try_files $uri $uri/ =404;
}
location ~ \.php$ {
	fastcgi_split_path_info ^(.+?\.php)(/.*)$;
	include fastcgi_params;
	fastcgi_param PATH_INFO       $fastcgi_path_info;
	fastcgi_index index.php;
	fastcgi_param  REDIRECT_STATUS    200;
	fastcgi_param  SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
	fastcgi_param  DOCUMENT_ROOT /var/www/html;
	fastcgi_pass php:9000;
}
nginx 日志
"GET /index.php/PHP%0Ais_the_shittiest_lang.php HTTP/1.1" 200
"GET /index.php/PHP%0ASOSAT HTTP/1.1" 404
|  |      1PHPer233      2019-11-11 22:18:31 +08:00 via Android 第一个 url 匹配了*.php 规则,第二个 url 没匹配上*.php 规则,所以是 404。 | 
|      2ysoserious OP @PHPer233 #1 忘了 $, 感谢提醒 |