You can pause incoming reqs, when your backend is down with Caddy’s lb_try_duration
and do retries with interval with lb_try_interval
policy.
Ref : https://til.simonwillison.net/caddy/pause-retry-traffic
If you want Caddy to forward the request to the next server available then you can specify a list of available upstreams/servers beforehand in the Caddyfile with lb_policy
set to first. Something like this :
Caddy will basically forward the request to the next available server and so on…
Checkout more load balancing options here
You can also swap in a new backend with dynamic upstreams, to which Caddy will route the held up as well as the new incoming requests.
More discussed in this github issue