location / { rewrite ^/$ http://$host/index/#/ break; if (!-e $request_filename){ rewrite ^/index/ /index/index.html break; rewrite ^(.*)$ /index.php?s=$1 last; break; } }