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

Support for URL Rewrite filter #1396

Merged
merged 3 commits into from
Dec 27, 2023
Merged

Conversation

sjberman
Copy link
Contributor

@sjberman sjberman commented Dec 15, 2023

Problem: As a user, I want to be able to configure URL rewrites for hostname and/or path rewrites on the server side.

Solution: Using the HTTPRoute filter API, a user can now configure a hostname and/or path-based rewrite. Hostname rewrite will update the Host header, while a path rewrite utilizes nginx's rewrite directive.

Enabled conformance tests for these features and added how-to guides. Due to the commonalities between redirects/rewrites, decided to just convert our HTTPS termination example into a user guide to cover our current redirect support.

Testing: Verified various combinations of rewrites using query params, headers, etc.

Closes #534

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@sjberman sjberman requested review from a team as code owners December 15, 2023 19:38
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 15, 2023
@sjberman
Copy link
Contributor Author

@ADubhlaoich Docs additions can be viewed in the second commit.

@sjberman sjberman force-pushed the enh/url-rewrite branch 2 times, most recently from a9c5be5 to 23f7b2e Compare December 18, 2023 17:27
internal/mode/static/nginx/config/http/config.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/http/config.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/servers.go Show resolved Hide resolved
internal/mode/static/nginx/config/servers.go Show resolved Hide resolved
internal/mode/static/nginx/config/servers_test.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/httproute.go Show resolved Hide resolved
internal/mode/static/nginx/config/servers.go Show resolved Hide resolved
internal/mode/static/nginx/config/servers.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/servers.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/httproute.go Show resolved Hide resolved
site/content/overview/gateway-api-compatibility.md Outdated Show resolved Hide resolved
Problem: As a user, I want to be able to configure URL rewrites for hostname and/or path rewrites on the server side.

Solution: Using the HTTPRoute filter API, a user can now configure a hostname and/or path-based rewrite. Hostname rewrite will update the Host header, while a path rewrite utilizes nginx's `rewrite` directive.

Enabled conformance tests for these features and added how-to guides.
Copy link
Contributor

@ADubhlaoich ADubhlaoich left a comment

Choose a reason for hiding this comment

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

LGTM! I addressed the comment about capitalisation in the relevant thread.

@sjberman sjberman enabled auto-merge (squash) December 27, 2023 15:13
@sjberman sjberman merged commit 0f465a7 into nginxinc:main Dec 27, 2023
27 checks passed
@sjberman sjberman deleted the enh/url-rewrite branch December 27, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Filter: HTTPURLRewriteFilter
5 participants