1

We have Reverse proxies looking like:

<rule name="ReverseProxy to service" stopProcessing="true">
    <match url="^service" />
    <action type="Rewrite"  logRewrittenUrl="true"  url="https://myco.com/{R:0}" />
</rule>

This Reverse Proxy points to a service that makes a SSO and redirects the visitor to an external site. We can fix the redirect with this solution: IIS reverse proxy interfering with redirect location header.

But when we disable "Reverse rewrite host in response headers" option, we face another error. Any internal redirection is set to public, though it should be proxy passed. It also affects session/cookie handling as it's impossible to log out as session/cookies are not cleared.

I have also tried this solution: IIS AAR - URL Rewrite for reverse proxy - how to send HTTP_HOST

But with preserveHostHeader enabled all Reverse proxies returns Bad Request.

How can I keep "Reverse rewrite host in response headers" option enabled and still keep the redirections to external sites work?

0 Answers0