server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location /api/ { proxy_pass http://backend:8000; proxy_http_version 1.1; # $http_host keeps the port so the API's Origin check sees the public address. proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location = /health { proxy_pass http://backend:8000/health; } # Fingerprinted bundles never change in place; index.html must be # revalidated or browsers keep running the previous release. location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location / { add_header Cache-Control "no-cache"; try_files $uri /index.html; } }