Skip to content

feat: support urlrewrite filter for individual backends#7826

Merged
jukie merged 4 commits intoenvoyproxy:mainfrom
MUzairS15:MUzairS15/feat/support-host-rewrite-for-backend
Dec 29, 2025
Merged

feat: support urlrewrite filter for individual backends#7826
jukie merged 4 commits intoenvoyproxy:mainfrom
MUzairS15:MUzairS15/feat/support-host-rewrite-for-backend

Conversation

@MUzairS15
Copy link
Copy Markdown
Contributor

What type of PR is this?

feat: support urlrewrite filter for individual backends

What this PR does / why we need it:
Enable URLRewrite filter on individual backendRefs in HTTPRoute configuration. Each backend can now have its own host rewrite
applied via Envoy's WeightedCluster.ClusterWeight.host_rewrite_literal.

"clusters": [
          {
            "hostRewriteLiteral": "rewritten-host-a.example.com",
            "name": "httproute/default/weighted-host-rewrite/rule/0/backend/0",
            "weight": 50
          },
          {
            "hostRewriteLiteral": "rewritten-host-b.example.com",
            "name": "httproute/default/weighted-host-rewrite/rule/0/backend/1",
            "weight": 50
          }
}

Tested via echo server with envoy-gateway exposed on localhost:10000:

curl  http://localhost:10000/test -H "host: test.gw"
{"host":{"hostname":"rewritten-host-b.example.com"}}

Which issue(s) this PR fixes:

Fixes #7775

Release Notes: Yes/No

@MUzairS15 MUzairS15 requested a review from a team as a code owner December 26, 2025 18:20
Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>
Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>
@MUzairS15 MUzairS15 force-pushed the MUzairS15/feat/support-host-rewrite-for-backend branch from b9aa9c7 to 0a34a62 Compare December 26, 2025 18:26
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.75%. Comparing base (122b4bf) to head (2eff6aa).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7826      +/-   ##
==========================================
+ Coverage   72.67%   72.75%   +0.08%     
==========================================
  Files         235      235              
  Lines       35035    35043       +8     
==========================================
+ Hits        25460    25496      +36     
+ Misses       7760     7737      -23     
+ Partials     1815     1810       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

arkodg
arkodg previously approved these changes Dec 26, 2025
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@arkodg arkodg requested review from a team December 26, 2025 21:34
zirain
zirain previously approved these changes Dec 27, 2025
@zirain
Copy link
Copy Markdown
Member

zirain commented Dec 27, 2025

@MUzairS15 can you fix the conflict?

Signed-off-by: Isaac Wilson <10012479+jukie@users.noreply.github.com>
@jukie jukie dismissed stale reviews from zirain and arkodg via 2eff6aa December 27, 2025 23:12
@jukie jukie requested review from arkodg and zirain December 27, 2025 23:12
@MUzairS15
Copy link
Copy Markdown
Contributor Author

/retest

@jukie jukie merged commit f8bb912 into envoyproxy:main Dec 29, 2025
71 of 78 checks passed
millermatt pushed a commit to millermatt/envoy-gateway that referenced this pull request Jan 4, 2026
)

* feat: support urlrewrite filter for individual backends

Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>

* update release notes

Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>

---------

Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>
Signed-off-by: Isaac Wilson <10012479+jukie@users.noreply.github.com>
Co-authored-by: Isaac Wilson <10012479+jukie@users.noreply.github.com>
Signed-off-by: Matt Miller <millermatt@outlook.com>
@aneesh-wolt
Copy link
Copy Markdown

I see v1.6.3 is released. This feature isn't included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify header for backenRefs

5 participants