Load balancer URL 404

I'm using zero trust tunnels to create 2 endpoints. I entered those 2 endpoints into load balancer settings. But the load balancer url doesn't work, even though monitor shows endpoints are healthy This is the load balancer hostname: 2530381.xyz https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/lb/
Cloudflare Docs
Load balancers · Cloudflare Zero Trust docs
When you create a tunnel, Cloudflare generates a subdomain of cfargotunnel.com with the UUID of the created tunnel. You can treat .cfargotunnel.com as …
No description
No description
18 Replies
Chaika
Chaika6mo ago
The tunnel itself, cloudflared, does routing based on the hostname/host header. It's going to get the hostname of the load balancer, is it setup to handle requests for that? If it's a dashboard managed tunnel it tries to force you to make a DNS Record for each Public hostname, you could instead use the "Add Host Header" and override it to a public hostname that the tunnel is handling, or use the catch-all If it's a local tunnel you could just modify your ingress config to handle requests for your lb hostname (or use the host header override, or catch-all fallback)
CK
CKOP6mo ago
I don't think I've set it up for that. What's the difference between dashboard managed and local tunnel? I'm using cloudflare dashboard.
Chaika
Chaika6mo ago
well if you don't have any public hostnames set up at all, what do you expect it to do with the traffic? the default is just to 404 dashboard tunnels are created in the zero trust dashboard and managed in there, local tunnels are all through CLI
CK
CKOP6mo ago
is this correct I'm totally new to this and not very technical and trying to learn how this works
Chaika
Chaika6mo ago
that's what I mean about the routing part of it. You don't need to override/set the host header in that side of the configuration, keep it blank To keep it short and simple, for that tunnel novato, you then want to in the load balancer pool endpoint configuration, add the host header override there for 0.2530381.xyz Right now the load balancer is forwarding traffic for 2530381.xyz and the tunnel is saying "idk, I don't have a configuration for this, I only have 0.2530381.xyz" easiest would probably be to give each tunnel different subdomains so you can always test directly and then override the host header for each in the endpoint settings of the pool.
CK
CKOP6mo ago
like this? hmmm, that didn't work
Chaika
Chaika6mo ago
endpoint address should be the cfargotunnel subdomain if you go to 0 in your DNS, it points to <guid>.cfargotunnel.com, for example: 9a31b917-bf88-40e1-b311-5db3d0c21235.cfargotunnel.com Those are what you want to copy into your endpoint address ps. If you were just aiming for basic redundancy and not any of load balancer's special routing stuff, you could deploy the same tunnel (called replicas) on more then one machine, and the routing is just "geographically closest" then random: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/deploy-tunnels/deploy-cloudflared-replicas/ depends what exactly you're looking for, wouldn't have to pay for lb requests in that case tho
CK
CKOP6mo ago
getting an error. the cfargo subdomains are the same for 0 and 1
Chaika
Chaika6mo ago
are you meaning to try to load balancer the same tunnel? That doesn't make much sense
CK
CKOP6mo ago
oh I see. I have services running on 2 different ports. Each port has its own endpoint. So yes, currently one tunnel for both endpoints. Do I need to separate to 2 tunnels, 1 tunnel for each endpoint? I'm trying to load balance across the 2 endpoints
Chaika
Chaika6mo ago
Why not run a load balance on the machine then? nginx can do it easily: https://nginx.org/en/docs/http/load_balancing.html you could just do two pools
CK
CKOP6mo ago
I am actually trying to load balance. So when I get a volume of api requests, they get distributed evenly across the endpoints. Replicas looks more like failure redundancy?
Chaika
Chaika6mo ago
replicas are failure redunancy yea, not even load balancing
CK
CKOP6mo ago
Cloudflare seems the easiest but I started looking into nginx proxy manager and caddy, but didn't figure out how to set it up yet. which one would you recommend for ease of setup? ok let me try this
Chaika
Chaika6mo ago
just doing two pools would probably be pretty easy, and CF LB does have a lot of easy gui stuff, and later on it'd be easy to even add more nodes in other locations and do more complex routing. The big downside I can think of is that you're paying for LB/per dns query whereas nginx on origin would be free, but up to you looks like it's working now
CK
CKOP6mo ago
yea it's working, thanks so much for the help! cloudflare docs don't even mention this and I've been banging my head for hours. You are amazing. You are right about the cost though I will try to switch over later. How much time does it take to set up nginx? And have you tried nginx proxy manager or caddy? Wondering how they compare
Chaika
Chaika6mo ago
I've always stuck to nginx but haven't tried out the built in nginx load balancer stuff before. Looks like Caddy has its own load balancer stuff too. Nginx is more mature/more resources around it, but I've heard Caddy is easier to configure and more of an accessible/friendly community around it, they've got their own discourse. I think on raw perf. tests nginx wins but unlikely you need the bit of extra perf. nginx has
CK
CKOP6mo ago
ok thanks for the thoughts. I'll give caddy a spin to start
Want results from more Discord servers?
Add your server