istio / istio

Connect, secure, control, and observe services.
https://istio.io
Apache License 2.0
35.92k stars 7.75k forks source link

Allow request rewrite before redirect #52521

Open zoonman opened 3 months ago

zoonman commented 3 months ago

Describe the feature request

The situation of certain rewrite before redirect is typical.

For example I want to have URL that looks like http://old-authority/old-prefix/somePattern/old-suffix to be redirected to https://new-authority/new-prefix/{pattern-match}/new-suffix.

This could be done via HTTPRewrite but it is not supported by HTTPRedirect.

Ideally this should operate like a pipeline where we have an input match, then transformation, then final action where we want to either redirect traffic to some external service or land it internally.

So we have it like:

  1. Match
  2. Rewrite
  3. Redirect or Route

The current implementation feels like there is a bug with request rewrite.

Describe alternatives you've considered

Custom built internal redirector service.

Affected product area (please put an X in all that apply)

Affected features (please put an X in all that apply)

Additional context

hzxuzhonghu commented 2 months ago

This is not possible from envoy implementation. Not sure why they donot support it

zoonman commented 2 months ago

This is not possible from envoy implementation. Not sure why they donot support it

This is exactly why I placed a feature request. If this issue boils down to envoy, then the envoy has to be modified.