My Java application deployed in 4 active servers(app1/app2/app3/app4). I use NGINX as load balancer to route traffic to my java application. NGINX is installed on 2 servers (lb1/lb2). Both nginx are active and serve requests at 50-50 ration
i want to secure my traffic to load balancers using Cloudflare tunnel.
so i created/configured Cloudflare tunnel locally on lb1 CNAME(cfargotunnel)record created automatically in Cloudflare UI and working perfect.
when i execute the same in lb2 its failing at below command
âcloudflared tunnel route dns prodshoptunnel2 shop.techxenonâ
getting error âFailed to add route: code: 1003, reason: An A, AAAA, or CNAME record with that host already existsâ
i understood that CNAME is already created by tunnel on lb1(prodshoptunnel1).
How to resolve this?
The point is i need to bring two NGINX load balancers into Cloudflare tunnel scope to serve traffic.
flow is Browserâ>CloudflareâNginx(loadbalancer1/2)âjava server
lb1â>tunnel id is abc-def.json(tunnel name is âprodshoptunnel1â)
lb2â>tunnel id is uvw-xyz.json(tunnel name is âprodshoptunnel2â).
as suggested, lb1 and lb2 have same config.yml and uuid.json(abc-def.json). it did not work.
i guess becasue as the tunnel id is maintained by Cloudflare which is not recognising this tunnel on lb2.
just to mention, i skipped âcloudflared tunnel route dns prodshoptunnel2 shop.techxenonâ on lb2.
Its working perfect on lb1 and lb2 but with a problem.
The connectors on lb1 and lb2 are shutting down(not persistent) or deleted when i logged out of machines.