refactor nginx

Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
Omar Sánchez Pizarro
2026-01-21 00:30:13 +01:00
parent ed2107086c
commit 53928328d4
11 changed files with 394 additions and 78 deletions

View File

@@ -33,17 +33,7 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# Login también va al dashboard
location /login {
proxy_pass http://dashboard:80;
proxy_http_version 1.1;
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;
}
# Dashboard Vue
# Dashboard Vue - pasar petición completa con prefijo /dashboard
location /dashboard {
proxy_pass http://dashboard:80;
proxy_http_version 1.1;
@@ -51,10 +41,6 @@ server {
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;
# Para SPA routing dentro de /dashboard - quitar el prefijo /dashboard
rewrite ^/dashboard/(.*)$ /$1 break;
rewrite ^/dashboard$ / break;
}
# Landing page (Astro) - raíz
@@ -66,11 +52,5 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}