45 lines
1.5 KiB
Plaintext
45 lines
1.5 KiB
Plaintext
# nginx for the docker production stack — HTTP on :80.
|
|
# TLS + domain are handled externally; this just serves the SPA and proxies API.
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
client_max_body_size 50m;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
# video / large-image generation can block minutes — avoid the 60s 504.
|
|
proxy_connect_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
|
|
# Hashed build assets never change — cache hard.
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
}
|
|
|
|
# SPA fallback; index.html must never be cached (else stale bundle hash).
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
# ---- API / media / health -> backend ----
|
|
location ^~ /admin/api/ { proxy_pass http://backend:6666; add_header Cache-Control "no-store" always; }
|
|
location ^~ /images/ { proxy_pass http://backend:6666; }
|
|
location = /health { proxy_pass http://backend:6666; }
|
|
# /v1 is per-API-key authenticated — never cache.
|
|
location ^~ /v1/ {
|
|
proxy_pass http://backend:6666;
|
|
add_header Cache-Control "no-store" always;
|
|
}
|
|
}
|