Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement request redirect filter in HTTPRoute rule #218

Merged
merged 4 commits into from
Sep 9, 2022

Conversation

pleshakov
Copy link
Contributor

Proposed changes

This PR implements the request redirect filter as part of the routing
rule in the HTTPRoute.

A common use-case for a request redirect is redirecting HTTP requests
to HTTPS. The PR updates the HTTPS termination example to include
HTTPS redirect configuration.

Notes:

  • The experimental 'path' field of 'requestRedirect' is out of scope.
  • The validation of the fields of requestRedirect is not implemented.
    It is left to be done in a separate component responsible for validation
    with FIXMEs added to the relevant code locations.
  • If multiple redirect filters are configured, NGINX Kubernetes Gateway
    will choose the first one and ignore the rest.
  • NGINX will always redirect a request even if the request has already
    been redirected. Thus, any backendRefs defined in the routing rule will
    be ignored. However, that "always redirect" behavior is not specified
    by the Gateway API. As a result, we might need to change our
    implementation if different behavior becomes specified by the Gateway API
    in the future.

examples/https-termination/README.md Outdated Show resolved Hide resolved
examples/https-termination/README.md Outdated Show resolved Hide resolved
internal/nginx/config/generator.go Show resolved Hide resolved
internal/nginx/config/generator.go Show resolved Hide resolved
internal/nginx/config/generator.go Show resolved Hide resolved
internal/nginx/config/generator.go Outdated Show resolved Hide resolved
internal/nginx/config/generator.go Outdated Show resolved Hide resolved
internal/nginx/config/generator.go Outdated Show resolved Hide resolved
pleshakov and others added 3 commits September 7, 2022 14:09
This commit implements the request redirect filter as part of the routing
rule in the HTTPRoute.

A common use-case for a request redirect is redirecting HTTP requests
to HTTPS. The commit updates the HTTPS termination example to include
HTTPS redirect configuration.

Notes:
- The experimental 'path' field of 'requestRedirect' is out of scope.
- The validation of the fields of `requestRedirect` is not implemented.
It is left to be done in a separate component responsible for validation
with FIXMEs added to the relevant code locations.
- If multiple redirect filters are configured, NGINX Kubernetes Gateway
will choose the first one and ignore the rest.
- NGINX will always redirect a request even if the request has already
been redirected. Thus, any backendRefs defined in the routing rule will
be ignored. However, that "always redirect" behavior is not specified
by the Gateway API. As a result, we might need to change our
implementation if different behavior becomes specified by the Gateway API
in the future.
Co-authored-by: Kate Osborn <[email protected]>
@pleshakov pleshakov merged commit 6da92d0 into main Sep 9, 2022
@pleshakov pleshakov deleted the feature/redirect branch September 9, 2022 16:43
@lucacome lucacome added the enhancement New feature or request label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants