Firstly I’m a super beginner to these things, trying to learn, please let me know in any ways you would like me to expand.
I’ve installed cloudflared tunnel onto my homelab machine through docker. I’ve gone through the steps as per the tunnel setup process (ran the connector through terminal). The tunnel is showing up in my portainer docker manager as “healthy” and whenever I add a public hostname SERVICE.MYDOMAIN.cloud everything looks good on the DNS side, but every time I try to access any services through that domain name I get cloudflare Error 502.
The strange thing is I’ve had it working in the past with some services, but now they’re all just throwing the same error.
What kind of steps should I be considering to troubleshoot?
I should add, I can reach these services via their ip address and port through any computer on my network. I can also access with localhost:(port) on any machine.
I’ve tried removing and reinstalling cloudflared tunnel, portainer, each service, all to no avail. I feel like I’m going around in circles
That makes sense, but the cloudflare tunnel is on the same machine as the services, even running in the same docker environment. That would mean it should work right?
How would i go about checking why the cloudflared tunnel can’t reach the services?
This is the full log in question for one of my services, they’re all the same:
2023-09-12T12:31:24Z ERR Request failed error=“Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp {ORIGIN SERVICE IP}: i/o timeout” connIndex=0 dest=https://{MY DOMAIN CONFIGURED WITH CF TUNNEL} event=0 ip={MY IP} type=http
When you say “If you are using the default network, then you won’t be able to resolve by hostnames of the containers.” does that mean that I’ll need to put the service containers in other environments? Cloudflared is pointing directly to the ip address and port, am I misinterpreting something here?
I’m not really quite sure what kind of action I need to take based on these logs. Reinstalling my containers, reinstalling cloudflared, reinstalling portainer, resetting my whole server (reinstalling ubuntu and starting again) all didn’t seem to work.
I mean I haven’t done anything crazy to my docker environment, so I’m not really sure what to look out for.
Containers on the default network don’t use docker custom DNS server docs.
What does your setup look like? Are binding ports to the host using -p and then your tunnel config points to the host IP address that has the ports bound?