fix(dashboard): use dynamic DNS resolution for API proxy
Nginx caches DNS at startup, so when dashboard-api restarts and gets a new container IP, the proxy breaks with 502. Use Docker's embedded DNS resolver (127.0.0.11) with a variable-based proxy_pass to re-resolve on every request. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,9 @@ server {
|
|||||||
|
|
||||||
# API 프록시 → 백엔드 컨테이너
|
# API 프록시 → 백엔드 컨테이너
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://dashboard-api:8080;
|
resolver 127.0.0.11 valid=10s;
|
||||||
|
set $backend http://dashboard-api:8080;
|
||||||
|
proxy_pass $backend;
|
||||||
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