From 547fb6290fc617c2fe37a14ced54e4746693c04a Mon Sep 17 00:00:00 2001 From: "skye.yue" Date: Mon, 15 Jun 2026 11:43:48 +0800 Subject: [PATCH] fix: use dynamic upstream resolver in nginx api proxy Add an explicit Docker resolver and switch the /api/ proxy to a variable-based upstream so nginx re-resolves cold-display-guard-api instead of caching stale DNS after the backend container restarts. Co-Authored-By: Claude --- web/nginx.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/nginx.conf b/web/nginx.conf index 79ac86d..5e942f8 100644 --- a/web/nginx.conf +++ b/web/nginx.conf @@ -2,11 +2,14 @@ server { listen 80; server_name _; + resolver 127.0.0.11 ipv6=off valid=10s; + root /usr/share/nginx/html; index index.html; location /api/ { - proxy_pass http://cold-display-guard-api:19080; + set $api_upstream http://cold-display-guard-api:19080; + proxy_pass $api_upstream; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;