Dynamic routing to downstream servers?

I am just evaluating Caddy for a specific project.

I was thinking of this type of architecture:

internet → caddy → server1, server2, server3.

The routing logic for caddy to send a request to server1, 2, or 3. Can it be dynamic in nature, but also cached?

i.e. Preload Caddy with 1000 domains, with a mapping from domain to server{1,2,3}.
If a new customer joins, I can then make a API call to caddy to tell it to map this new domain to server#2. Or remove the mapping.

Is this possible?

What does it mean?

Take a look at the reverse_proxy directive page, specifically “Upstreams” and “Load balancing”

1 Like