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

Fix reload errors for NGINX when large num of match conditions are used #1799

Closed
wants to merge 1 commit into from

Conversation

salonichf5
Copy link
Contributor

Proposed changes

Problem: A large number of match conditions for a single hostname/path cause reload errors with NGINX about being parameter being too long

Solution: The solution is to divide the http_matches into different sets and then parse them through NGINX using NJS to map the correct match condition

Testing: TODO

Closes #1107

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.


@github-actions github-actions bot added the bug Something isn't working label Apr 2, 2024
{{- end }}
js_content httpmatches.redirect;
Copy link
Contributor

Choose a reason for hiding this comment

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

This directive shouldn't exist if there are no HTTPMatchVars

throw Error(
`cannot redirect the request; error parsing ${r.variables[MATCHES_VARIABLE]} into a JSON object: ${e}`,
);
while (true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this loop just overwriting the matches var every time? So when you look for a match, you're only looking at the last iteration.

@salonichf5
Copy link
Contributor Author

opening another PR for this

@salonichf5 salonichf5 closed this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Large number of match conditions can cause reload errors
2 participants