location / { index index.php index.html; if (!-e $request_filename) { rewrite ^/index.php(.*)$ /index.php?s=$1 last; #必须在前面 rewrite ^(.*)$ /index.php?s=$1 last; break; } }