At the moment we are migrating a customer from on-premises to Azure, without the use of any web-adaptor on the front-side.
It was surprising but in the Azure's Application Gateway (AAG) the defacto X-Forwarded-Host standard header is not set, but one of MS's own concoction: X-Original-Host.
While waiting a solution be implemented in AAG by the IT provider, we implemented for the meanwhile the following as solution on the internal Portal server:
- Configured IIS, installed a Web Adaptor and IIS' URL Rewrite Module.
- In IIS, under the URL Rewrite module created a Server Variable with as name "HTTP_X_FORWARDED_HOST".
- In URL Rewrite created a rewrite rule where the Server Variable HTTP_X_FORWARDED_HOST is assign a value like mynicename.mydomain.net.
- After activating the rule, the IIS itself takes care that the X-Forwarded-Host is added to all requests.