Here’s the problem: the program at 172.15.0.20:80 thinks it’s running in the web root. I’ve written on this topic a bit before:
The “other methods” I mention at the bottom there are HTML filtering with the filter plugin as well as an undocumented feature of proxy that allows regex rewriting of returning headers. You’ll need to capture all instances of links to subresources that aren’t already prepended with your chosen subfolder and then prefix them with that correct subfolder.
https://caddyserver.com/v1/docs/http.filter
Regex rewriting of upstream/downstream headers in proxy by comp500 · Pull Request #2144 · caddyserver/caddy · GitHub