Need help - how to setup a failover downstream server

. Caddy version:

2.6.2

2. How I installed, and run Caddy:

a. System environment:

Ubuntu 22.04.1 LTS (jammy) on Upcloud

b. Command:

caddy run

d. My complete Caddy config:

rptest.aaa.com {
reverse_proxy * {
to http://152.44.1.1 http://209.50.1.2
fail_duration 1d
max_fails 1
}
}

3. The problem I’m having:

I’m trying to implement ALL downstream requests going to the 2nd server once the first server is unhealthy.

Using the config shown above, it appears to be load balancing - I can see BOTH servers getting traffic, not just the first one listed.

I dont want that.
I don’t need load balancing.
I’m trying to create a failover server in the event 1st server has an issue.

I think my config is using “passive health checking”, per the docs.
I could use Active as well - I have a static URL I could hit on the primary server to see if it gets a response.

I don’t see any code examples for this use case.
thx

I think you’re looking for lb_policy first.

yes, thank you.
worked peferct.

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