events { worker_connections 1024; } http { include mime.types; sendfile on; server { listen 80; listen [::]:80; server_name vdo.ninja; root /app/static; index index.html; location ~ ^/([^/]+)/([^/?]+)$ { root /app/static; try_files /$1/$2 /$1/$2.html /$1/$2/ /$2 /$2/ /$1/index.html; add_header Access-Control-Allow-Origin *; } location / { if ($request_uri ~ ^/(.*)\.html$) { return 302 /$1; } try_files $uri $uri.html $uri/ /index.html; add_header Access-Control-Allow-Origin *; } } }