Introduced support for load balancing through upstream hosts and customizable Real IP header source#5413
Open
genticflowlabs wants to merge 6 commits intoNginxProxyManager:developfrom
Conversation
|
Docker Image for build 6 is available on DockerHub: Note Ensure you backup your NPM instance before testing this image! Especially if there are database changes. Warning Changes and additions to DNS Providers require verification by at least 2 members of the community! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream Hosts, Real IP Header setting, and Cloudflare compatibility
Closes #5374
Closes #156
Heavily influenced by #5184
Summary
This PR introduces two major features: Upstream Hosts for load balancing across multiple backend servers, and a configurable Real IP Header setting that fixes Access List IP whitelisting when behind Cloudflare or other CDNs.
Features
Upstream Hosts
A new first-class entity for managing reusable nginx
upstreamgroups. Upstream hosts support three load balancing methods: round-robin, least connections, and IP hash, each with configurable server weights.upstream_host,upstream_host_server), internal logic, REST API (/api/nginx/upstream-hosts), access control rules, schema definitions, and nginx template (upstream_host.conf)upstream_hostandupstream_host_servertables, addsupstream_host_idforeign key toproxy_hostreact-selectdropdown matching the proxy host UXReal IP Header Setting
A new global setting under Settings > Real IP Header that controls which HTTP header nginx uses for
real_ip_header. This enables Access Lists to work behind Cloudflare.X-Real-IP(default),CF-Connecting-IP(Cloudflare),X-Forwarded-For, or a custom header namereal_ip_headerdirective is moved from the staticnginx.confinto the dynamically generatedip_ranges.conf. Changing the setting triggers config regeneration and nginx reloaddefault-siteandreal-ip-headervaluesStartup Config Regeneration
All nginx host configs are now deleted and regenerated from current templates on every startup. This ensures configs on disk always match the current template version after an upgrade, preventing stale configs from blocking nginx. For example, if a template change adds or removes a directive, old configs with the previous format would cause nginx to fail to start. Regenerating on startup eliminates this class of issues entirely.
Translations
All new keys are translated across all 22 supported locales (bg, cs, de, es, et, fr, ga, hu, id, it, ja, ko, nl, no, pl, pt, pt_br, ru, sk, tr, vi, zh) with proper native-language translations.
AI Disclosure
AI (Claude) was used as a development assistant during this work. All changes have been tested on a deployed instance, however I would greatly appreciate additional QA help from the community to cover edge cases across different configurations and environments.