diff --git a/deploy/nginx-m1.conf b/deploy/nginx-m1.conf index dae7fe7..d086807 100644 --- a/deploy/nginx-m1.conf +++ b/deploy/nginx-m1.conf @@ -6,8 +6,10 @@ server { # SPA: fall back to index.html for any path # Proxy API calls to the FastAPI backend (M3+) + # Use variable to defer DNS resolution (docker service name "fastapi") location /api/ { - proxy_pass http://fastapi:8000; + set $fastapi_upstream fastapi; + proxy_pass http://$fastapi_upstream:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade';