generated from nholtware/service-template-react
32 lines
822 B
Text
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;
|
|
}
|
|
}
|