Rewrite the hostname part of the 302 Location header response

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.

  • Valentin Tobi
  • Apr 2 2022
  • Attach files
  • Nikolay Dimitrov commented
    August 29, 2023 14:21

    Have you tried playing with the XC Route option as you can send Redirects to it based on the URL/header match?



  • Arjun Ayapparaj commented
    August 16, 2023 17:04

    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/

  • Ralf Bruenig commented
    July 26, 2022 13:39

    If we use DNS discovery for the origin server, we could by default rewrite redirects from the discovery domain towards the Global LB domain.