Summary
URLRewrite path filters under backendRefs[].filters are accepted on an HTTPRoute, but the generated Envoy route config does not include the rewrite. The backend receives the original path.
Moving the same URLRewrite to rule-level rules[].filters works and generates the expected Envoy regex_rewrite / prefix_rewrite.
Environment
- Envoy Gateway release:
v1.7.0
- Kubernetes Gateway API:
v1.4.1
- Envoy proxy from config dump:
1.37
Reproducer
BackendRef-level rewrite, exact path:
- matches:
- path:
type: Exact
value: /rewrite/url/exact
backendRefs:
- name: http-echo-doc
port: 80
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /modified/url/rewrite/url/exact
BackendRef-level rewrite, prefix path:
- matches:
- path:
type: PathPrefix
value: /rewrite/url/path-prefix
backendRefs:
- name: http-echo-doc
port: 80
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /replaced-prefix
Observed behavior
The route is accepted, but generated Envoy config has no rewrite fields.
Non-working exact path route shape:
"match": {
"path": "/rewrite/url/exact"
},
"route": {
"weighted_clusters": {
"clusters": [
{
"name": ".../rule/2/backend/0",
"weight": 1
}
]
}
}
Non-working prefix path route shape:
"match": {
"path_separated_prefix": "/rewrite/url/path-prefix"
},
"route": {
"weighted_clusters": {
"clusters": [
{
"name": ".../rule/3/backend/0",
"weight": 1
}
]
}
}
Live curl confirms the backend still sees the original path:
/rewrite/url/exact
/rewrite/url/path-prefix/my/path
Expected behavior
Either:
- BackendRef-level
URLRewrite should be translated into Envoy route rewrite config, or
- If backendRef-level
URLRewrite is unsupported, the HTTPRoute should not be accepted silently; status should indicate the unsupported/incompatible filter.
Working comparison
When the same rewrite is moved to rule-level rules[].filters, Envoy config includes the expected rewrite.
Working exact path route shape:
"match": {
"path": "/rewrite/url/exact"
},
"route": {
"cluster": ".../rule/2",
"regex_rewrite": {
"pattern": {
"regex": "^/.*$"
},
"substitution": "/modified/url/rewrite/url/exact"
}
}
Working prefix path route shape:
"match": {
"path_separated_prefix": "/rewrite/url/path-prefix"
},
"route": {
"cluster": ".../rule/3",
"prefix_rewrite": "/replaced-prefix"
}
Summary
URLRewritepath filters underbackendRefs[].filtersare accepted on anHTTPRoute, but the generated Envoy route config does not include the rewrite. The backend receives the original path.Moving the same
URLRewriteto rule-levelrules[].filtersworks and generates the expected Envoyregex_rewrite/prefix_rewrite.Environment
v1.7.0v1.4.11.37Reproducer
BackendRef-level rewrite, exact path:
BackendRef-level rewrite, prefix path:
Observed behavior
The route is accepted, but generated Envoy config has no rewrite fields.
Non-working exact path route shape:
Non-working prefix path route shape:
Live curl confirms the backend still sees the original path:
/rewrite/url/exact/rewrite/url/path-prefix/my/pathExpected behavior
Either:
URLRewriteshould be translated into Envoy route rewrite config, orURLRewriteis unsupported, theHTTPRouteshould not be accepted silently; status should indicate the unsupported/incompatible filter.Working comparison
When the same rewrite is moved to rule-level
rules[].filters, Envoy config includes the expected rewrite.Working exact path route shape:
Working prefix path route shape: