location / { if (!-e $request_filename) { rewrite /admin.php(.*)$ /admin.php?s=/$1 last; #存在admin.php rewrite /index.php(.*)$ /index.php?s=/$1 last; #存在index.php rewrite ^(.*)$ /index.php?s=/$1 last; #不存在index.php break; } }
location / { if (!-e $request_filename) { rewrite /admin.php(.*)$ /admin.php?s=/$1 last; #存在admin.php rewrite /index.php(.*)$ /index.php?s=/$1 last; #存在index.php rewrite ^(.*)$ /index.php?s=/$1 last; #不存在index.php break; } }