I’ve got the base domain working fine. for example domain.com/monit
proxy /monit :8081 {
without /monit
}
However all the links on the page lead to the root domain… So a link on the page would read https://domain.com/sublink
I’ve tried a lot of different regex rules, but in all honesty I don’t know what I’m doing with it. I found an nginx config which I tried converting
The nginx proxy_redirect function rewrites Location headers coming back from upstream to conform to the location accessed by the client.
Caddy can’t easily manipulate the Location header in this way yet, but there’s an outstanding pull request with this functionality: https://github.com/mholt/caddy/pull/2144
Once it’s merged, you can make use of that - and http.filter for links in HTML - to reverse proxy an app into a folder without the app having to support that configuration.
In the mean time, you’ll need to configure any app to use the correct base path, or give it a subdomain rather than a subfolder.