homelab.setup icon indicating copy to clipboard operation
homelab.setup copied to clipboard

Why do you need caddy?

Open AlexMikhalev opened this issue 2 years ago • 2 comments

Apologies for asking in issues: Great project, but I was wondering why do you need caddy if you are using cloudflared tunnels?

AlexMikhalev avatar Dec 29 '22 19:12 AlexMikhalev

Thanks, and as you said, Caddy wasn't in my plan when I was starting, it came out as a convinence requirement for certain apps. Some apps like Vikunja, Immich have a microservices architecture, and hence each of these μservices are running as different containers. Caddy helps me in pinning these into a single port, via different routes. Like say /api for the backend, /web for the website and so on.

That way I'll be able to have only a single Cloudflare Tunnel which exposes that single port. Sure, the other option could also be multiple tunnels, like api.example.com pointing to :8081, web.example.com pointing to :8080 and so on. But I chose the former option.

Ref: https://github.com/rounakdatta/homelab.setup/blob/main/templates/Caddyfile.j2

rounakdatta avatar Dec 30 '22 08:12 rounakdatta

Thank you for the great explanation. I am evaluating options for the same type of setup - between nginx, traefik and caddy. My preference would be none of them :-D

AlexMikhalev avatar Dec 30 '22 11:12 AlexMikhalev