1. Caddy version (caddy version
):
v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=
2. How I run Caddy:
caddy run
a. System environment:
Debian GNU/Linux 10
b. Command:
caddy run
c. Service/unit/compose file:
d. My complete Caddyfile or JSON config:
domain.com {
reverse_proxy 10.10.10.101 {
header_up X-Forwarded-Proto https
header_up X-Forwarded-Port 443
}
3. The problem I’m having:
I would like to implement a redirect that change both the location and case of the extension for all files ending with:
https://domain.com/oldmedia/filename.JPG
https://domain.com/oldmedia/filename.JPEG
https://domain.com/oldmedia/filename.PNG
https://domain.com/oldmedia/filename.GIF
https://domain.com/oldmedia/filename.MOV
https://domain.com/oldmedia/filename.AVI
https://domain.com/oldmedia/filename.MPG
So they would be lowercase:
https://domain.com/newmedia/filename.jpg
https://domain.com/newmedia/filename.jpeg
https://domain.com/newmedia/filename.png
https://domain.com/newmedia/filename.gif
https://domain.com/newmedia/filename.mov
https://domain.com/newmedia/filename.avi
https://domain.com/newmedia/filename.mpg
4. Error messages and/or full log output:
5. What I already tried:
Searched all documentation but still am not sure how to accomplish this.
Would this be possible with something like
redir https://domain.com/oldmedia/*.JPG https://domain.com/newmedia/{uri}.jpg
But then I would end up at
https://domain.com/newmedia/filename.JPG.jpg