How to get The reverse_proxy directive to strip the path of the request before forwarding the request upstream

Make sure your { match all the closing }. You have an extra one now at the end of the reverse_proxy line.

That’s not a problem with Caddy. You need to configure your upstream app to be aware of the subpath you’re proxying to, since it constructs the HTML which contain the script tags.

Using handle_path, Caddy will only handle requests which have /version1* in the path. Other requests will go unhandled, which results in an empty 200 response. You either need to configure Caddy to handle those other requests with another handle block, or configure your upstream app to avoid needing to do the handle_path in Caddy.