Can caddy gracefully handle a new version of an backend API service?

Can caddy gracefully transition my old service version to a new one to provide 0 downtime updates?

Say I have the following:

http://example.com/api/

This request are routed to a API application that is running locally on:

localhost:3000/api

Now I want to push an update to my server, start that new service version and say I run it on a different port:

localhost:3001/api

Can I tell caddy to complete finishing requests on the old api running on port 3000, and eventually shut that down.

Send all new requests to the port 3001 latest version?

Is this a common practice for updates, any other better options?

Yes, Caddy handles config reloads gracefully.

2 Likes

that’s great.

what about graceful draining of existing connections?

Done as well

2 Likes