1. The problem I’m having:
I have this working Caddy config:
https://mysite {
reverse_proxy backend-container:8000
forward_auth * https://external-auth-service {
uri /api/v2/auth
}
}
Which works correctly. I now, however, want to cache the responses from the auth service so I’m not hammering it with requests. I’ve added cache-handler
to Caddy, but can’t work out how to cache responses from the auth service without caching responses from backend-container. Is this possible?
2. Error messages and/or full log output:
N/A
3. Caddy version:
2.9.1
4. How I installed and ran Caddy:
Dockerfile:
FROM caddy:2.9.1-builder AS builder
RUN xcaddy build \
--with github.com/caddyserver/cache-handler
FROM caddy:2.9.1-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
I’m deploying this with Kamal, which is simply doing a docker run
.