1. The problem I’m having:
I have an HTTP upstream application which is served from a subfolder /foo. The application is aware that its served from a subfolder so some kind of “baseURL” is in place. The app is currently reachable from the intranet via http://IP-of-the-server/foo.
The goal is to make it reachable from the internet via https://foo.domain.tld.
I managed to get it working with https://foo.domain.tld/foo, but I want to get rid of the /foo path in the domain.
2. Error messages and/or full log output:
N/A
3. Caddy version:
v2.11.2
4. How I installed and ran Caddy:
apt install caddy- Run by systemd as described in the caddy documentation
a. System environment:
- Ubuntu 24.04.4 LTS
b. Command:
N/A
c. Service/unit/compose file:
N/A
d. My complete Caddy config:
foo.domain.tld {
route {
rewrite / /foo{uri}
reverse_proxy * http://IP {
header_up Host {host}
header_up X-Real-IP {remote_host}
}
}
}
5. Links to relevant resources:
I have read The "subfolder problem", OR, "why can't I reverse proxy my app into a subfolder?" but do not know how to turn this into a working config.