修改nginx.conf,找到server中的 location ~ .php${},修改为location ~ .php {},并增加以下内容:

set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info;

如果仍未解决,在ThinkPHP入口文件index.php中加入配置define(‘PHP_FILE’,$_SERVER[‘SCRIPT_NAME’]);