Caddy's reverse_proxy directive supports multiple upstream backends out of the box. Generate a Caddyfile that distributes traffic evenly and fails over gracefully.
List several upstreams in reverse_proxy and pick a policy.
example.com {
reverse_proxy 10.0.0.1:8080 10.0.0.2:8080 {
lb_policy least_conn
health_uri /healthz
}
}Caddy supports active health checks with health_uri and health_interval, so failed backends leave rotation without extra software.
Open the Load balancer generator
random. Set lb_policy to round_robin, least_conn, ip_hash and others as needed.