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

feat(streams): Simple Load Balancing of Streams #3841

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Teagan42
Copy link

@Teagan42 Teagan42 commented Jun 30, 2024

Credit to https://github.com/eedev - Their PR was marked stale: #1999

Motivation

I wanted to use Nginx Proxy Manager to do some simple load balancing for a EMQX cluster, seems I am not alone:

Description

I followed #1999 - unfortunately, that PR is very stale, so it was easier to branch off of upstream develop and re-implement the changes and perform the eslint fixes.

If your stream contains multiple upstreams - it will use the least connection strategy and max_fails=3

Alternative Approaches

A more robust solution would allow for specifying the upstream port for each of the forwarding hosts (upstreams). I did toy around with this but decided it was more work than I wanted to do right now and was worried it may break other user configurations.

Future Enhancements

  • Advanced Options: Load Balancing Strategies, Allow Different Ports per Upstream, Other Proxy Settings
  • SSL

Screenshots

image

@nginxproxymanagerci
Copy link

Docker Image for build 2 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-3841

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@z499738316
Copy link

希望能把此pr能合并,正需要此功能

@@ -167,7 +167,7 @@
"add": "Add Stream",
"form-title": "{id, select, undefined{New} other{Edit}} Stream",
"incoming-port": "Incoming Port",
"forwarding-host": "Forward Host",
"forwarding-hosts": "Forward Hoss",

Choose a reason for hiding this comment

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

Suggested change
"forwarding-hosts": "Forward Hoss",
"forwarding-hosts": "Forward Hosts",

@CRASH-Tech
Copy link

Please merge it

@JohnnyBoomKek
Copy link

this would be great, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants