Skip to content

Conversation

fabian4
Copy link
Contributor

@fabian4 fabian4 commented Sep 8, 2025

Proposed changes

Problem: Add regex for path matching

external (regex path match without any head/method/queryparams condition)

exact: /foo => = /foo
prefix: /foo => = /foo + ^~ /foo/
regex: /foo/(.*)$ => ~ /foo/(.*)$

Closes #3110

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • 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

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Add regex support for path matching

Copy link

nginx-bot bot commented Sep 8, 2025

Hi @fabian4!

Thanks for opening this pull request!
Be sure to check out our Contributing Guidelines while you wait for someone on the team to review this.

@nginx-bot nginx-bot bot added the community label Sep 8, 2025
@fabian4 fabian4 marked this pull request as draft September 8, 2025 15:12
@fabian4 fabian4 force-pushed the add_regex_for_path_matching branch 2 times, most recently from 2202934 to 72227ea Compare September 9, 2025 15:28
@sindhushiv sindhushiv added this to the v2.2.0 milestone Sep 10, 2025
@sindhushiv sindhushiv moved this from 🆕 New to External Pull Requests in NGINX Gateway Fabric Sep 10, 2025
@salonichf5
Copy link
Contributor

Hey @fabian4, thanks a lot for your contribution to NGINX Gateway Fabric!

I noticed there are still some parts left in this PR—were you looking for initial feedback before continuing development, or are you planning to submit this in parts?

@fabian4
Copy link
Contributor Author

fabian4 commented Sep 12, 2025

Hi @salonichf5, thanks a lot for the comment! I kept this PR as a draft since there are still some parts I’d like to finish up. In the meantime, getting some early feedback would be super helpful — that way I can adjust things early and make sure I’m heading in the right direction. Really appreciate your input!

@fabian4 fabian4 closed this Sep 12, 2025
@fabian4 fabian4 force-pushed the add_regex_for_path_matching branch from 72227ea to 54135b5 Compare September 12, 2025 15:14
@github-project-automation github-project-automation bot moved this from External Pull Requests to ✅ Done in NGINX Gateway Fabric Sep 12, 2025
@fabian4 fabian4 reopened this Sep 12, 2025
@github-project-automation github-project-automation bot moved this from ✅ Done to 🆕 New in NGINX Gateway Fabric Sep 12, 2025
@sjberman sjberman moved this from 🆕 New to External Pull Requests in NGINX Gateway Fabric Sep 12, 2025
@fabian4 fabian4 force-pushed the add_regex_for_path_matching branch from c76e809 to 63c06fe Compare September 14, 2025 04:47
@salonichf5
Copy link
Contributor

Hi @salonichf5, thanks a lot for the comment! I kept this PR as a draft since there are still some parts I’d like to finish up. In the meantime, getting some early feedback would be super helpful — that way I can adjust things early and make sure I’m heading in the right direction. Really appreciate your input!

For sure, we will get some eyes on it. Thank you again for the contribution.

@fabian4 fabian4 marked this pull request as ready for review September 22, 2025 06:58
@sjberman sjberman added the enhancement New feature or request label Sep 22, 2025
@sjberman
Copy link
Collaborator

@fabian4 We'll be sure to review this soon!

In the meantime, I ran the pipeline and there are some linting/unit test errors. Also, please be sure to follow this guide for formatting your main commit message and PR description. And please update the release note section the PR description as well, so we can include a notein our CHANGELOG when this ultimately gets released.

Problem: As regex path matching is missing support for NGF.

Solution: Add support for regex path matching, only allow a full path rewrite/redirect after the regex path match.

Testing: Add additional unit test case for regex path match.
@fabian4 fabian4 force-pushed the add_regex_for_path_matching branch from 194ac10 to ff24ee1 Compare September 22, 2025 15:15
@github-actions github-actions bot removed the enhancement New feature or request label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: External Pull Requests
Development

Successfully merging this pull request may close these issues.

Regex for path matching: RegularExpression
6 participants