修改后重启Nginx12345location /子目录/ {if (!-e $request_filename) {rewrite ^(.*)$ /子目录/index.php$1 last;}}根目录规则:123if (!-e $request_filename) {rewrite ^(.*)$ /index.php$1 last;}