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>
24 lines
575 B
Nginx Configuration File
24 lines
575 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
resolver 127.0.0.11 ipv6=off valid=10s;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location /api/ {
|
|
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;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|