Nginx "proxy_pass container.xd;" causes a lot of connection refused - how to resolve to ipv4 instead of ipv6?

I think the nginx resolver directive is what you want as it can take an option to disable ipv6 record look ups.