Placeholders with default handling?


Is there a possibility to use something like:


Why? I want a fallback to {bar} if there is no {foo}.


proxy /api my-api:80 {
    without /api
    header_upstream X-Forwarded-Path {>X-Forwarded-Path:-{path}}


I don’t think there’s a way to do that, actually. You might have to request this feature at the Caddy Github.

I imagine this could be a relatively simple change to the httpserver replacer logic to allow this kind of fallback for an empty placeholder.

1 Like

Good idea. I opened

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.