Skip to content

Add worker connections field to NginxProxy #3611

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

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

sarthyparty
Copy link
Contributor

Proposed changes

Problem: Users were unable to configure worker connections

Solution: Add field to nginxproxy that allows users to configure worker connections. Read that field and put it into the main conf.

Testing: Manual testing and unit tests for the new code

Closes #3371

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.


@sarthyparty sarthyparty requested a review from a team as a code owner July 9, 2025 22:09
@github-actions github-actions bot added the enhancement New feature or request label Jul 9, 2025
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.87%. Comparing base (947cfdd) to head (81addf3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3611   +/-   ##
=======================================
  Coverage   86.86%   86.87%           
=======================================
  Files         127      127           
  Lines       15271    15287   +16     
  Branches       62       62           
=======================================
+ Hits        13265    13280   +15     
- Misses       1851     1852    +1     
  Partials      155      155           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@salonichf5
Copy link
Contributor

we need to add validation check for the field workerConnection, just to ensure that any value other than the valid range is rejected by the spec

@sjberman
Copy link
Collaborator

we need to add validation check for the field workerConnection, just to ensure that any value other than the valid range is rejected by the spec

@salonichf5 I would disagree. This validation that you linked is mainly to ensure secure string values in nginx config to avoid injection. In this case, we are using an integer, and nginx has no limitations on the value (that I'm aware of). So in that case, I think it's fine to let our CRD schema handle validation upfront.

@salonichf5
Copy link
Contributor

we need to add validation check for the field workerConnection, just to ensure that any value other than the valid range is rejected by the spec

@salonichf5 I would disagree. This validation that you linked is mainly to ensure secure string values in nginx config to avoid injection. In this case, we are using an integer, and nginx has no limitations on the value (that I'm aware of). So in that case, I think it's fine to let our CRD schema handle validation upfront.

sounds good, my initial assumption was to do this for all fields. But the above makes sense.

@sjberman
Copy link
Collaborator

@salonichf5 Totally fair. It's a conversation we've gone back and forth on in the past. I think we settled on doing the extra validation on fields that could represent security concerns, otherwise let the CRD schema handle it.

Copy link
Contributor

@ciarams87 ciarams87 left a comment

Choose a reason for hiding this comment

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

🔥

@sarthyparty sarthyparty force-pushed the feature/worker-connections branch from 6f15aa9 to 00433d1 Compare July 10, 2025 17:21
@sarthyparty sarthyparty force-pushed the feature/worker-connections branch from 00433d1 to 81addf3 Compare July 10, 2025 17:26
@sarthyparty sarthyparty changed the title add worker connections field to nginxproxy Add worker connections field to nginxproxy Jul 10, 2025
@sarthyparty sarthyparty changed the title Add worker connections field to nginxproxy Add worker connections field to NginxProxy Jul 10, 2025
@sarthyparty sarthyparty enabled auto-merge (squash) July 10, 2025 17:36
@sarthyparty sarthyparty disabled auto-merge July 10, 2025 17:40
@sarthyparty sarthyparty enabled auto-merge (squash) July 10, 2025 17:40
@sarthyparty sarthyparty merged commit bdc1047 into main Jul 10, 2025
43 checks passed
@sarthyparty sarthyparty deleted the feature/worker-connections branch July 10, 2025 17:51
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Jul 10, 2025
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
Status: Done
Development

Successfully merging this pull request may close these issues.

Allow for configuring worker_connections
4 participants