在Nginx配置文件中,把这段代码server{location/{indexindex.phpindex.htmlindex.html.php;自动索引;if(!-e$request_filename){#一级目录#rewrite^/(.*)$/index.php/$1last;#二级目录请改成你自己的项目目录这里rewrite^/rent/public/(.*)$/rent/public/index.php/$1last;}}#将PHP脚本传递给侦听127.0.0.1:9000的FastCGI服务器#location~\.php(.*)${fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_split_path_info^((?U).+\.php)(/?.+)$;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;fastcgi_paramPATH_INFO$fastcgi_path_info;fastcgi_paramPATH_TRANSLATED$document_root$fastcgi_path_inf
