http://www.chinaz.com/fake.jpg/foo.php
为什么会这样呢?比如,如下的nginx conf:
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.*)") {
set $script $1;
set $path_info $2;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
通过正则匹配以后,SCRIPT_NAME会被设置为"fake.jpg/foo.php",继而构造成SCRIPT_FILENAME传递个PHP CGI,但是PHP又为什么会接受这样的参数,并且把a.jpg解析呢?