service-template-react/nginx/default.conf
nholtware 9fd6fd1d26 feat: initial Vite/React frontend service template
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 02:27:23 -06:00

32 lines
822 B
Text

server {
listen 8080;
server_name _;
root /usr/share/nginx/html;
# Liveness/readiness for k8s probes.
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
# Runtime config, written at container start; never cache.
location = /config.js {
add_header Cache-Control "no-store" always;
}
# Hashed build assets: cache forever; a missing asset is a real 404.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-cache" always;
}
# SPA fallback: unknown paths get index.html; the router handles them.
location / {
try_files $uri /index.html;
}
}