server { listen 80; server_name localhost; gzip_static on; # Set root for all locations root /usr/share/nginx/html; # Security headers for all locations add_header X-UA-Compatible "IE=Edge"; add_header X-Frame-Options SAMEORIGIN; add_header X-XSS-Protection "1; mode=block;"; add_header X-Content-Type-Options nosniff; # Only cache files in /console/_app/immutable/ for 1 year location /console/_app/immutable/ { try_files $uri =404; expires 1y; add_header Pragma public; add_header Cache-Control "public"; } # All other /console requests (no cache) location /console { index index.html index.html; try_files $uri /console/index.html; } location / { absolute_redirect off; return 301 /console; } }