Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
I’ll answer my own question for anyone else having the same issue.
After days of trying to figure out what the issue was, a Stack Overflow answer on an unrelated topic pointed me in the right direction. I knew that when getting the connection refused error cURL was having difficultly resolving the domain only when being called on the same server for some reason (still don’t know why).
So, adding a record to /etc/cloud/templates/hosts.debian.tmpl pointing the misbehaving domain to 127.0.0.1 seems to have done the trick. Of all the domains/subdomains I have there is only one having this issue. Again, I still have no idea why but at least the connection refused errors have ceased.
Thanks a lot for your post.
I was having kind of the same issue although mine wasn’t intermittent. We probably had different issues but your post lead me into investigating domain.
In my case the problem was an entry on /etc/hosts pointing my service domain to 127.0.0.1. After removing this entry connections from the same server started working properly.
Leaving this here so it may help somebody else in the future.