diff --git a/Elecciones-Web/frontend/frontend.nginx.conf b/Elecciones-Web/frontend/frontend.nginx.conf index d1f6335..a8d7186 100644 --- a/Elecciones-Web/frontend/frontend.nginx.conf +++ b/Elecciones-Web/frontend/frontend.nginx.conf @@ -1,4 +1,4 @@ -# frontend-admin/frontend.nginx.conf +# frontend/frontend.nginx.conf (Y también en frontend-admin) server { listen 80; @@ -7,12 +7,17 @@ server { root /usr/share/nginx/html; index index.html; + # 1. Manejo explícito para el manifest.json + # El '=' hace que sea una coincidencia exacta y de alta prioridad. + location = /manifest.json { + # Evita que el navegador guarde en caché el manifest, que puede cambiar con cada build. + add_header 'Cache-Control' 'no-cache, no-store, must-revalidate'; + # Intenta servir el archivo. Si no existe, devuelve un 404 real. + try_files $uri =404; + } + + # 2. Manejo de todas las demás rutas para la SPA location / { try_files $uri $uri/ /index.html; } - - location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|svg|woff|woff2)$ { - expires 1y; - add_header Cache-Control "public"; - } } \ No newline at end of file