When the "Host rewrite" feature is enabled on the HTTP Loadbalancer and the backend server responds with 302 redirects with absolute path Location header (which includes the hostname the was rewritten by the HTTP LB), we need a way to rewrite the hostname part of the path in the Location header back to what the client initially requested, otherwise the client will try to redirect to an internal hostname, breaking the connection.
Have you tried playing with the XC Route option as you can send Redirects to it based on the URL/header match?
Attachments Open full size
I think there should be a way to rewrite any request/response headers as shown here.
https://azure.microsoft.com/en-us/blog/rewrite-http-headers-with-azure-application-gateway/
Attachments Open full size
If we use DNS discovery for the origin server, we could by default rewrite redirects from the discovery domain towards the Global LB domain.
Attachments Open full size