From 8a159f1b797ed9a7dd095982dc8e8cccf2cde663 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Mon, 22 Jun 2026 17:05:41 -0700 Subject: [PATCH] Update rolac.conf --- deploy/vm/nginx/conf.d/rolac.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deploy/vm/nginx/conf.d/rolac.conf b/deploy/vm/nginx/conf.d/rolac.conf index e7ecf46..7889c4c 100644 --- a/deploy/vm/nginx/conf.d/rolac.conf +++ b/deploy/vm/nginx/conf.d/rolac.conf @@ -2,9 +2,16 @@ server { listen 80; server_name _; + # Docker's embedded DNS. Using a variable for the upstream below forces nginx + # to re-resolve via this resolver instead of caching the container IP at + # startup — so api/app can be recreated (new IPs on redeploy) without nginx + # holding a stale IP and returning 502. + resolver 127.0.0.11 valid=10s ipv6=off; + # API -> api container. The SPA calls same-origin /api/... (environment.prod.ts). location /api/ { - proxy_pass http://api:8080/api/; + set $upstream_api api; + proxy_pass http://$upstream_api:8080$request_uri; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -13,6 +20,7 @@ server { # Everything else -> the Angular static app (its own nginx does SPA fallback). location / { - proxy_pass http://app:80; + set $upstream_app app; + proxy_pass http://$upstream_app:80; } }