diff --git a/dashboard-sqdc/nginx.conf b/dashboard-sqdc/nginx.conf index 86a3b13..3ad6b3f 100644 --- a/dashboard-sqdc/nginx.conf +++ b/dashboard-sqdc/nginx.conf @@ -1,8 +1,8 @@ server { listen 80; - server_name localhost; + server_name _; root /usr/share/nginx/html; - index index.html; + index index.html index.htm; # Gzip compression gzip on; @@ -12,7 +12,7 @@ server { # API proxy location /api/ { - proxy_pass http://localhost:3001/; + proxy_pass http://127.0.0.1:3001/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; @@ -23,7 +23,13 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - # React app - handle client-side routing + # Static assets with caching + location /static/ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # React app - handle client-side routing (must be last) location / { try_files $uri $uri/ /index.html; add_header Cache-Control "no-cache, no-store, must-revalidate"; @@ -31,12 +37,6 @@ server { add_header Expires "0"; } - # Static assets with caching - location /static/ { - expires 1y; - add_header Cache-Control "public, immutable"; - } - # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always;