server { listen 8080; client_max_body_size 1M; keepalive_timeout 15; types_hash_max_size 2024; root /app; location = / { # Instead of handling the index, just # rewrite / to /index.html rewrite ^ /index.html; } location / { # Serve a .gz version if it exists gzip_static on; # Try to serve the clean url version first try_files $uri.html $uri/index.html $uri =404; } location = /favicon.ico { # This never changes, so don't let it expire expires max; } location ^~ /theme { # This content should very rarely, if ever, change expires 1y; } }