diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 5e86569..2297cff 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -7,7 +7,12 @@ server { } location /api/ { - proxy_pass http://backend:8080/; + # Resolve the Docker service at request time. This prevents Nginx from + # exiting when the Docker DNS entry is not ready during container startup. + resolver 127.0.0.11 ipv6=off valid=10s; + set $backend_upstream http://backend:8080; + rewrite ^/api/(.*)$ /$1 break; + proxy_pass $backend_upstream; proxy_http_version 1.1; proxy_set_header Host $host;