1. Caddy version (caddy version
):
2.3.0
2. How I run Caddy:
Caddyfile is used
a. System environment:
OS X
AWS Linux 2 AMI
Not using Docker
b. Command:
caddy run
c. Service/unit/compose file:
n/a
d. My complete Caddyfile or JSON config:
appsite.local localhost {
reverse_proxy 127.0.0.1:8000
file_server
}
applink.local {
redir https://appsite.local/app?token={uri} permanent
}
3. The problem I’m having:
I am trying to redirect clients coming in to one domain (similar to a URL shortener) to a different domain.
the pattern coming in is
applink.local/<token here>
the pattern coming out (redirect) I want is:
appsite.local/app?token=<token here>
at which I am failing miserably.
4. Error messages and/or full log output:
5. What I already tried:
I have tried
uri strip_prefix /
but this doesn’t seem to remove the leading /