I didn't test, but should be possible with forward_auth (https://caddyserver.com/docs/caddyfile/directives/forward_auth)
I didn't test, but should be possible with forward_auth (https://caddyserver.com/docs/caddyfile/directives/forward_auth)