envoyproxy/gateway

HTTPRouteFilter's urlRewrite does not take effect under backendRefs

Open

#7099 aperta il 29 set 2025

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Go (802 fork)auto 404
help wanted

Metriche repository

Star
 (2871 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

The urlRewrite of HTTPRouteFilter does not work under backendRefs, but it works under rules. Is this as expected?

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: HTTPRouteFilter
metadata:
  name: backend-1-credential-injection
  namespace: envoy-gateway-system
spec:
  urlRewrite:
    hostname:
      header: x-custom-host
      type: Header
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
  name: backend-node3-fqdn-1
  namespace: envoy-gateway-system
spec:
  endpoints:
    - fqdn:
        hostname: application-1.hardybrown.com
        port: 65201

-------not work config----

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: httprouter-to-node3
  namespace: envoy-gateway-system
spec:
  parentRefs:
    - name: eg
  hostnames:
    - "envoy.hardybrown.com"
  rules:
    - backendRefs:
        - group: gateway.envoyproxy.io
          kind: Backend
          name: backend-node3-fqdn-1
          filters:
            - type: ExtensionRef
              extensionRef:
                group: gateway.envoyproxy.io
                kind: HTTPRouteFilter
                name: backend-1-credential-injection
      matches:
        - path:
            type: PathPrefix
            value: /

-------work config----

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: httprouter-to-node3
  namespace: envoy-gateway-system
spec:
  parentRefs:
    - name: eg
  hostnames:
    - "envoy.hardybrown.com"
  rules:
    - backendRefs:
        - group: gateway.envoyproxy.io
          kind: Backend
          name: backend-node3-fqdn-1
      matches:
        - path:
            type: PathPrefix
            value: /
      filters:
            - type: ExtensionRef
              extensionRef:
                group: gateway.envoyproxy.io
                kind: HTTPRouteFilter
                name: backend-1-credential-injection

Guida contributor