diff --git a/src/infra/nginx.conf b/src/infra/nginx.conf index 2a4875e..d90c9f6 100644 --- a/src/infra/nginx.conf +++ b/src/infra/nginx.conf @@ -22,7 +22,9 @@ server { resolver_timeout 5s; set $backend_url ${API_BACKEND_URL}; proxy_pass http://$backend_url; - proxy_set_header Host $host; + # Use the backend hostname, not the incoming request's Host. + # Prevents routing loops when an ALB uses Host-based routing. + proxy_set_header Host $backend_url; 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;