diff --git a/frontend/nginx.conf b/frontend/nginx.conf index cb501fe..ad0504d 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -16,18 +16,10 @@ server { add_header Expires "0"; } - # No cache for CSS and JS to allow quick updates - location ~* \.(css|js)$ { - add_header Cache-Control "no-cache, no-store, must-revalidate"; - add_header Pragma "no-cache"; - add_header Expires "0"; - } - - # Cache images only - location ~* \.(jpg|jpeg|png|gif|ico|svg)$ { - expires 7d; - add_header Cache-Control "public, max-age=604800"; - } + # API proxy to backend service + # For Kubernetes: set BACKEND_HOST env var or use service name + # For Docker Compose: backend service name is 'backend' + location /api/ { # In Kubernetes, this will be: oramap-backend:3000 # In Docker Compose, this will be: backend:3000 # Default to backend:3000 @@ -47,7 +39,16 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - # API proxy to backend service - # For Kubernetes: set BACKEND_HOST env var or use service name - # For Docker Compose: backend service name is 'backend' - location /api/ { + # No cache for CSS and JS to allow quick updates + location ~* \.(css|js)$ { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + add_header Expires "0"; + } + + # Cache images only + location ~* \.(jpg|jpeg|png|gif|ico|svg)$ { + expires 7d; + add_header Cache-Control "public, max-age=604800"; + } +}