Rewrite http request based on response location header


Make a request to Istio (1.0.6) proxy to upstream via virtual_service. Service is responding with header newuri , with httpStatus code ie 307 - I know that redirect should works by designe with 302 and location header. But I want to make a redirect handling based on http error. I tried using envoyFilters with lua but all features are related to stream handling (request/response headers mod) rather than rewrite or request forward .

So the request path looks like this:

  • client is making request ie curl http:// foo/ path
  • proxy is forwarding request to upstream
  • upstream is responding with custom header ie “newLocation: http:// blabla/ path2” as value
  • while header exist in response, proxy is doing new request to newLocation
  • client see response from the newLocation

Thanks for any help :wink:

1 Like

@bucken Were you able to resolve this. I am having a similar issue.

Not really :wink: we do have drop using istio than, but for now its v1.7 mayby its fixed. We customize nginx as sidecard proxy together with other nginx as api gateway. I can suggest to rethink traffic route :wink:


I also had to put nginx in between. Looks like envoy folks are still working on this feature.