envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Doesn envoy support different path rewrite for each endpoint

Open ningyougang opened this issue 1 year ago • 1 comments

for upstream endpoint, e.g.

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
...
spec:
  configPatches:
  - applyTo: CLUSTER
    match:
      cluster:
        service: backend.target-namespace
      context: GATEWAY
    patch:
      operation: MERGE
      value:
        load_assignment:
          endpoints:
          - lb_endpoints:
            - endpoint:      # endpointA
                address:
                  socket_address:
                    address: xxx.xxx.xxx.xxx
                    port_value: 9999
          - lb_endpoints:
            - endpoint:      # endpointB
                address:
                  socket_address:
                    address: xxx.xxx.xxx.xxx
                    port_value: 10000

Does above endpointA and endpointB support path rewrite like below?

- match:
  - uri:
      prefix: /a
  rewrite:
    endpointA: /endpointA/a
    endpointB: /endpointB/a
- match:
  - uri:
      prefix: /b
  rewrite:
    endpointA: /endpointA/b
    endpointB: /endpointB/b

i checked envoy doc, does not find any info about that.

Have any idea about this?

ningyougang avatar May 10 '24 07:05 ningyougang

im wondering if this is more a question for https://github.com/envoyproxy/gateway

there is an overview of path rewriting here https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_routing that may be helpful

phlax avatar May 10 '24 09:05 phlax

I will close because http route supports path rewrite, but cluster's each endpoint does not support path rewrite

ningyougang avatar May 14 '24 00:05 ningyougang