IIS 7 and Above
Application Request Routing (ARR)
Last post Jul 14, 2019 08:47 PM by Chris Becke
Jul 12, 2019 07:20 AM|bijux|LINK
I've an application behind ARR with 2 IIS servers in the pool. But the application requires to be accessed by it's own hostname. Meaning if we access it by
www.condoso.com, then host header should be changed to server1.mysite.com and server2.mysite.com to the respective servers. How do I do that? And how can I verify if the host header has been changed from the IIS logs?
Jul 12, 2019 01:45 PM|lextm|LINK
You should set preserveHostHeader to false. To verify host headers, use a tool like Wireshark.
Jul 14, 2019 08:47 PM|Chris Becke|LINK
There are two ways of dealing with this: Let ARR fill in the HOST header, or supply it yourself.
There is a single, server-wide setting for ADD: preserveHostHeaders, that does not have a setting in the ARR GUI but if you open up the IIS Manager's Configuratrion editor for your server you can find the proxy settings under system.webServer.proxy
Typically it defaults to false, which causes ARR to re-write the host its routing to, set it to true and it passes through
As Ive always encountered this setting as false by default, then
In the case that it must remain on, then you might want to try adding ARR rules that explicitly set the HTTP header. In the specific ARR rules for the site:
In the case that ARR is not setting the correct server name: If its a web farm I'd start by checking that the web farm is set up with the servers by their names, not by ip's or short hostnames.