Repository navigation
Conversation
…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>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
#9252 reports that a
responseOverrideredirect works forhttp://requests but not forhttps://ones, and that settingredirect.schemedoesn'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 incrementscustom_response_redirect_no_routeand lets the original response through (redirect_policy.cc, "Don't allow a redirect to a non existing route").In the issue, the
error-pagesHTTPRoute that serves the redirect target hasparentRefs: [{name: default, sectionName: http}]:error-pages.redirect.local, so the redirect is skipped and the original 404 is returned.redirect.schemeonly changes the:schemeof 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:
codespellis clean, and the note follows the samealertshortcode as other task pages.Which issue(s) this PR fixes:
Fixes #9252
PR Checklist
git commit -s). See DCO: Sign your work./api.make generate gen-check,make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, butgen-check,lint, and coverage MUST pass.) N/A: docs only.release-notes/current/breaking_changes/.