In Caddy 1, we were able to use
proxy / https://host.com/path
To reverse to a host+path.
I encountered the same error as this issue:
https://github.com/caddyserver/caddy/issues/2905
But I couldn’t understand the conclusion of the issue.
My use case is the following. I have a an Object Storage/S3 bucket at OVH. It is available at this URL:
https://storage.de.cloud.ovh.net/v1/<id>/mstdn-media
An object is available at:
https://storage.de.cloud.ovh.net/v1/<id>/mstdn-media/file.jpg
With this config for media.mstdn.io
proxy / https://storage.de.cloud.ovh.net/v1/<id>
The users of my app were able to access it as https://media.mstdn.io/mstdn-media/file.jpg
.
With Caddy 2, I can’t specify a pass for reverse_proxy
.
With this:
reverse_proxy https://storage.de.cloud.ovh.net
My Caddy will proxy file.jpg
to
https://storage.de.cloud.ovh.net/mstdn-media/file.jpg
and not
https://storage.de.cloud.ovh.net/v1/<id>/mstdn-media/file.jpg
The /v1/<id>
is missing and <id>
has to stay private so I can’t update my app to add it in the user-facing URL: Caddy has to add it.
Is there a directive for Caddy 2 that allows me to do that? rewrite
maybe? I searched the documentation but couldn’t find anything.
Thanks!