server { listen 80; location / { try_files $uri /index.html; } location ~ ^/.+/$ { rewrite .* /index.html last; } }