Skip to content

docs: explain that a responseOverride redirect target must be routable on the same listener - #10472

Open
lyelgate wants to merge 1 commit into
envoyproxy:mainfrom
lyelgate:docs/response-override-redirect-route
Open

lyelgate wants to merge 1 commit into
envoyproxy:mainfrom
lyelgate:docs/response-override-redirect-route

Conversation

@lyelgate

@lyelgate lyelgate commented Nov 1, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

#9252 reports that a responseOverride redirect works for http:// requests but not for https:// ones, and that setting redirect.scheme doesn't help.

The cause is in how Envoy follows the redirect, not the scheme. A responseOverride redirect is implemented with Envoy's custom response filter (RedirectPolicy). It rewrites the request's host, path and scheme, clears the route cache, and asks for the route again on the same HTTP connection manager, so the same listener's route table. If nothing matches, it gives up quietly: it increments custom_response_redirect_no_route and lets the original response through (redirect_policy.cc, "Don't allow a redirect to a non existing route").

In the issue, the error-pages HTTPRoute that serves the redirect target has parentRefs: [{name: default, sectionName: http}]:

  • A request received on the HTTP listener finds the error-pages route, so the redirect works.
  • A request received on the HTTPS listener is routed against the HTTPS listener's routes, which don't include error-pages.redirect.local, so the redirect is skipped and the original 404 is returned.
  • The reporter noticed it "works" with a wildcard certificate, which is the case where the route also attaches to the HTTPS listener.
  • redirect.scheme only changes the :scheme of the internal request. It doesn't move the request to another listener, which is why setting it had no effect.

Envoy Gateway can't change that lookup, and generating routes on other listeners for redirect targets would be surprising. So the fix is to document it where users configure redirects. The note explains that the target must match a route attached to the listener that received the request, what happens when it doesn't (with the counter to look for), and that the fix is to attach the target route to that listener too.

Changes:

  • site/content/en/latest/tasks/traffic/response-override.md: a note after the introduction to redirects.

Testing:

  • Docs only. codespell is clean, and the note follows the same alert shortcode as other task pages.

Which issue(s) this PR fixes:

Fixes #9252


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: N/A: no changes under /api.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.) N/A: docs only.
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A: docs only.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR.
  • Release notes: N/A: docs only.
  • Generated files committed: N/A: no API, Helm chart or module changes.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

…e on the same listener

A responseOverride redirect is followed inside Envoy by the custom
response filter, which recomputes the route on the HTTP connection
manager that received the original request. If no route on that
listener matches the redirect target, Envoy skips the redirect and
sends the original response.

That is what envoyproxy#9252 runs into: the error-pages HTTPRoute is attached only
to the HTTP listener, so a request received on the HTTPS listener has
no route for the redirect host. Document this, how to spot it, and that
the redirect scheme does not select another listener.

Fixes envoyproxy#9252

Signed-off-by: Lakhan Yelgate <39281685+lyelgate@users.noreply.github.com>
@lyelgate
lyelgate requested a review from a team as a code owner November 1, 2026 09:48
@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit c3d6d41
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae6fcfa0e1c20ba33137478
😎 Deploy Preview https://deploy-preview-10472--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T08:51:48.936279Z c3d6d41 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

responseOverride fails when scheme does not match

1 participant