mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 01:15:51 +03:00
[PR #3841] feat(streams): Simple Load Balancing of Streams #3769
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#3769
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3841
Author: @Teagan42
Created: 6/30/2024
Status: 🔄 Open
Base:
develop← Head:feat/stream-load-balancing📝 Commits (8)
f368985feat(streams): Add multiple upstreams for basic load balancingffeb190feat(streams): Regex for host or host with portf65f15afeat(streams): Remove schema for host,ipv4,ipv6 with port85e7ebafeat(streams): Add migration for chaning `forwarding_host' to 'forwarding_hosts'499933echore(streams): Lint fixes32fb98fFix templated007b5cfeat(streams): Add least connection and max_fails if hosts > 1fb5e40aUpdate frontend/js/i18n/messages.json📊 Changes
10 files changed (+148 additions, -28 deletions)
View changed files
➕
backend/migrations/20240629165112_stream_load_balance.js(+42 -0)📝
backend/models/stream.js(+17 -7)📝
backend/schema/endpoints/streams.json(+25 -9)📝
backend/templates/stream.conf(+27 -4)📝
frontend/js/app/nginx/stream/form.ejs(+3 -3)📝
frontend/js/app/nginx/stream/form.js(+25 -1)📝
frontend/js/app/nginx/stream/list/item.ejs(+5 -1)📝
frontend/js/app/nginx/stream/list/main.ejs(+1 -0)📝
frontend/js/i18n/messages.json(+2 -2)📝
frontend/js/models/stream.js(+1 -1)📄 Description
Credit to https://github.com/eedev - Their PR was marked stale: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/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
Screenshots
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.