Rewrite HTTPS proxy redirects?

when I have this Caddy config: {
    proxy /

When I click link on , the webpage redirects to another .

How can I get Caddy to rewrite webpages, so I can continue using for browsing, and it does not redirect to different URL in my browser?

Well, Caddy isn’t configured here to do any redirects. Are you sure you have cleared your browser cache?

Maybe the backend is sending the browser a redirect?

Yes backend redirects to another subdomain to provide auth.

Is there any way to handle that?

You could try:

    proxy_header Host {host}
    proxy_header X-Real-IP {remote}
    proxy_header X-Forwarded-For {remote}
    proxy_header X-Forwarded-Proto {scheme}

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.