Why doesn't Application Gateway populate X-Forwarded-Host header?
Previously I have followed this Microsoft guide on configuring applications to work behind reverse proxies by using the X-Forwarded-Host
header, however Azure Application Gateway does not include this header and link generation, redirects, etc. are not working correctly as a result. It does however include a bunch of other X-Forwarded-
headers but not this one for some reason.
It seems bizarre that the first guide cites conventional behaviour for reverse proxies (i.e. setting the X-Forwarded-Host
header) which is then not followed by Microsoft's own reverse proxy implementation, and furthermore there is no mention in that guide as to how to use X-Original-Host
which the documentation states is provided by Application Gateway and I presume is the intention?
I'll look into workarounds such as header rewrites, but I don't understand the disconnect here.
EDIT - Using a rewrite in application gateway is a workaround, as is I assume configuring the ForwardedHostHeaderName
property similar to as shown here.