1. The problem I’m having:
I’m using an API server behind Caddy. The API server produces files on request which I want to serve via Caddy (file_server
).
I’m using a wildcard *
for the proxy and /store/*
for file_server
.
Even though the file_server
matcher is longer and should be preferred, the proxy wildcard matcher always takes precedence.
I verified the file_server
matcher working by disabling the proxy - in that case it works as expected.
2. Error messages and/or full log output:
No error output, I just always end up at the proxy server even if a path starting with /store/<foobar>
is used.
3. Caddy version:
2.6.2
4. How I installed and ran Caddy:
sudo apt install caddy
a. System environment:
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux trixie/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=trixie
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
b. Command:
systemctl start caddy
c. Service/unit/compose file:
Debian default, I’m sure they did a good job.
d. My complete Caddy config:
:80 {
root * /srv/
file_server /store/*
reverse_proxy localhost:8001
}
5. Links to relevant resources:
n/a