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 <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,14 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
|
resolver 127.0.0.11 ipv6=off valid=10s;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
location /api/ {
|
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_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user