We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Replicating reverseRewriteHostInResponseHeaders in URLRewriteRSS

2 replies

Last post Jun 26, 2017 06:04 PM by anantaneja

  • Replicating reverseRewriteHostInResponseHeaders in URLRewrite

    Jun 22, 2017 07:48 PM|anantaneja|LINK

    I have the same issue as OP in https://forums.iis.net/t/1160195.aspx.

    One of the answers was : 'You lose the fixup of Set-Cookie and Location headers that ARR does - the next beta of URLRewrite v2 will include the capability to have rules to rewrite response headers, so at that point, you should be able to not use reverseRewriteHostInResponseHeaders'

    My questions:

    1. Since the answer is pretty old, can someone confirm that reverseRewriteHostInResponseHeaders ONLY fixes the Set-Cookie and Location headers and no others ?
    2. Can someone post an efficient rewrite rule(s) which replicates reverseRewriteHostInResponseHeaders ?

  • Re: Replicating reverseRewriteHostInResponseHeaders in URLRewrite

    Jun 23, 2017 07:45 AM|Yuk Ding|LINK

    Hi anantaneja,

    I think the answer means that you could use URL rewrite V2 to create the URL rewrite outbound urle to rewrite the header like set-cookie or location. Of course, you could rewrite other response headers.

    This link provide the sample outbound rule to rewrite response header:

    https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-20-configuration-reference#Setting_Response_Headers

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: Replicating reverseRewriteHostInResponseHeaders in URLRewrite

    Jun 26, 2017 06:04 PM|anantaneja|LINK

    Hi Yuk,

    Thanks for the reply! The doc link was helpful.

    My primary concern is with #1 : Which of the response headers does 'reverseRewriteHostInResponseHeaders' change ? Is it ONLY Set-Cookie and Location ? Or are there others ?

    Also for Set-Cookie header(s), what part of the header value is replaced ? Is it just the part after 'Domain' (an example is below)

    Set-Cookie: <cookie-name>=<cookie-value>; Domain=<domain-value>

    Or is it a find+replace for the complete header value ?

    Reg #2 : Does 'reverseRewriteHostInResponseHeaders' internally also use regex match and replace ? I'm curious if there will be a performance impact of switching to URL re-write ?

    Thanks,
    Anant