Persist config across multiple caddy server instances

I am investigating if Caddy can persist the cofig (hosts + proxy backend) among instances.

For example i have 2 caddy servers, each on separate server and IP.
Both caddy servers use the same storage (consul) for TLS (this works fine).

I have X domains which point in DNS to both IPs (for scalability issues purposes).

Ideally i wold just spin off the caddy servers, then via API on one of them, i would add the host config which would be replicated to the other caddy instances (since all use consul).

From what i can see, the config is persisten individually on each caddy server.
Consul storage is used only for TLS.

Should i use caddy.config_loaders to load the config from a remote URL ?
I guess this config is read only on start so with each change i would have to reload the caddy servers.

Any other options ?

This is correct. That’s the best approach currently.

Caddy currently only has very limited support for watching for config changes, via the --watch option. I don’t recommend using it in production, it’s more meant as a convenience for development.

You can watch this issue to find out when such a feature is available (or help build it if you can offer the time).

This topic was automatically closed after 30 days. New replies are no longer allowed.