1. The problem I’m having:
Q: Hi, Is it possible to make caddy retry reverse proxy calls to the application server if they fail the first time?
I have something like this:
main.localhost {
reverse_proxy http://main:80
}
But this returns a blank page when the server goes down for even a couple seconds.
What I would like to happen is when app goes down, caddy attempts to reverse proxy the request about 3 to 5 times with a delay of 1 second between the retries, before finally returning 5xx to the client(the client would just have a loading circle in the meantime), but any other way to achieve a similar thing is ok too.
I need this for hot reloading. My setup is single-node, but if the solution necessitates running multiple replicas it’s okay too.
So far I’ve tried setting lb_try_duration
, didn’t seem to work. Please point me in the right direction.
2. Error messages and/or full log output:
No errors. Blank page is returned
3. Caddy version:
v2.7.6 (caddy:latest)
4. How I installed and ran Caddy:
docker compose.
a. System environment:
I omitted the rest of the template as it has almost nothing to do with my current configuration or compose.