CloudFlare & DigitalOcean

I deployed cloudflare with docker on my DigitalOcean droplet. Then I have set up a zero trust tunnel. With the url localhost. In the end this didn't worked. So I had to use the public IP. Does someone know why it's not possible to use localhost:8080 for example, when the cloudflare container runs on the same host?
6 Replies
Hello, I’m Allie!
localhost is referring to the Docker container itself, and not the droplet. To hit whatever server you have set up, they need to be on the same Docker network, then you could point the Tunnel to it like this: http://somecontainer:8080
Roman
RomanOP9mo ago
But on the same host are multiple containers running. So they should be on the same docker network, right?
Hello, I’m Allie!
By default, yes. You should then be able to route traffic to them by using their hostname
Roman
RomanOP9mo ago
In this case I nee to get the host name of the other two containers and that’s it?
Hello, I’m Allie!
Yes, plus the port the containers expose their service on(if it is 80, it should be fine to omit). The hostnames should be the name of the container, by default anyway
Roman
RomanOP9mo ago
Thank you very much for your help 🙏🏻
Want results from more Discord servers?
Add your server