I use caddy as a reverse proxy. What I want to do is proxying my.domain/xxx/yyy to xxx.destination.domain/yyy. Here xxx and yyy is not sure. So I am wondering if I could use wildcards and capture groups in the Caddyfile.
For example, I can write as this with nginx:
I think you could manage it by abusing rewrites, if either the hostname or the URI were static… but not with both being dynamic.
The proxy directive doesn’t support dynamic backends or regex capture/substitution at the moment, but it’s an often-requested feature. Here’s the relevant Github issue: