Change Location in Response Header


I want to use Caddy as a reverse proxy for multiple containers. I however want to use paths to do the redirection with. Example caddy-host/srv1/* → server1/, caddy-host/srv2/ → server2/*.

Upstream I get it to work fine, but the reponses include absolute paths (in the Location header). I’d therefore would like to update the Location header by prepending the correct path.

Example of what I’d like to do:

    http://caddy-host {
        root /var/www
        proxy /srv1 server1 {
            without /srv1
    	header_downstream Location /srv1{>Location}

Doesn’t work (tried a lot of different ways). Any ideas, anyone?

Thanks in advance!

