nginx.conf 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. server {
  2. listen 80;
  3. server_name _;
  4. root /usr/share/nginx/html;
  5. index index.html;
  6. add_header X-Content-Type-Options "nosniff" always;
  7. add_header Referrer-Policy "strict-origin-when-cross-origin" always;
  8. location = /healthz {
  9. access_log off;
  10. return 204;
  11. }
  12. location = /index.html {
  13. add_header Cache-Control "public, max-age=0, must-revalidate" always;
  14. try_files $uri =404;
  15. }
  16. location = /compare.html {
  17. add_header Cache-Control "public, max-age=0, must-revalidate" always;
  18. try_files $uri =404;
  19. }
  20. location ~* \.(?:js|mjs|css|wasm|worker|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
  21. add_header Cache-Control "public, max-age=31536000, immutable" always;
  22. try_files $uri =404;
  23. }
  24. location /example/ {
  25. add_header Cache-Control "public, max-age=86400" always;
  26. try_files $uri =404;
  27. }
  28. location /vendor/ {
  29. add_header Cache-Control "public, max-age=31536000, immutable" always;
  30. try_files $uri =404;
  31. }
  32. location / {
  33. try_files $uri $uri/ /index.html;
  34. }
  35. }