1. Caddy version (caddy version
):
2.4.1
2. How I run Caddy:
Running in Docker, in Kubernetes.
a. System environment:
See Above
b. Command:
caddy run
c. Service/unit/compose file:
FROM caddy:2.4.1
COPY Caddyfile /etc/caddy/Caddyfile
EXPOSE 80 443
d. My complete Caddyfile or JSON config:
{
auto_https off
}
:80, :443 {
reverse_proxy /http-bind http://ejabberd:5281 {
transport http {
dial_timeout 3s
}
}
log {
output stdout
format console
}
}
3. The problem I’m having:
When running Caddy as a reverse proxy in my kubernetes cluster, when pods restart they come back up with a new internal ip address. The first request that gets reverse proxied to them then fails. Subsequent requests succeed just fine.
What I would like to happen is have some way to tell caddy to refetch DNS for these reverse proxy directives if they end up hanging for a certain amount of time.
4. Error messages and/or full log output:
None
5. What I already tried:
Tries using the settings in reverse_proxy
like the health checks, but I’m not sure if thats the right solution.
6. Links to relevant resources:
NA