How can I get Caddy to rewrite webpages, so I can continue using https://sub.domain.com for browsing, and it does not redirect to different URL in my browser?
in your proxy directive (I assume you’re still running 0.8.3). In 0.9 these will be replaced with the transparent preset and proxy_header becomes header_upstream.