I changed my config to the following:
location /client_data {
resolver 127.0.0.11 valid=60s;
resolver_timeout 5s;
set $upstream_client_data web:5000;
proxy_pass http://$upstream_client_data$uri;
}
Now it works!
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279953,279956#msg-279956