Let me start off, I love caddy, it’s so simple and gets all my sites up and running in no time.
Occasionally, the host I’m running caddy on dies, stops and I push to a new host and carry on…but it’s not automatic. And while I could run multiple instances of caddy, or make it participate in a swarm, it still leaves one part I can’t solve…how the external request to port 443 (for example) is port forwarded to my caddy instance.
Manually I handle this by having some internal server names all pointing to the ip where my caddy instance exists:
So any request to internal is pointed at my caddy instance, which has that certificate, and redirects a sub page.
With external I have a port 443 port forward to the 192.168.0.7 machine.
But where I’m stuck, if if I lose 192.168.0.7 - and have to move to a new machine.
Ideally I’d like caddy to be a single address - always, and regardless of the host hosting caddy, it presents the same ip or address. Even in swarm mode with multiple managers, you still have to point external references at any of the managers hosts, which doesn’t give me a lot of benefit.
I see people talking about load balancers, but surely that has the same problem as the swarm managers, in that you now have multiple end points that you have to manage.
Any ideas on how I might achieve an single address for any number of caddy instances (ok I only really need 2), so that if one is down, the other is used? And have one address in my dns and port forwarding set up?