1. Caddy version (caddy version
): 2.4.5
2. How I run Caddy:
docker-compose up caddy (with official caddy:alpine)
a. System environment:
N/A
b. Command:
N/A
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
fancydomain.com {
handle / {
rewrite * /pages/lp
reverse_proxy nuxt:8001
}
handle /* {
reverse_proxy nuxt:8001
}
}
3. The problem Iām having:
For backend reasons, I need to reverse proxy index ( https://fancydomain.com ) to /pages/lp and everything else do just reverse proxy with same path.
E.g.
/ ā nuxt:8001/pages/lp (The Special case I am trying to introduce)
/xyz ā nuxt:8001/xyz
/hello/world ā nuxt:8001/hello/world
4. Error messages and/or full log output:
No Error messages, but it is letting
https://fancydomain.com go to nuxt:8001/ instead of https://fancydomain go to nuxt:8001/pages/lp
5. What I already tried:
If I remove the handle /*
part (see below) then it works with the special case, but everything else fails.
It seems like the handle /*
overrides the handle /
.
fancydomain.com {
handle / {
rewrite * /pages/lp
reverse_proxy nuxt:8001
}
}
6. Links to relevant resources:
N/A