NginxProxyManager / NginxProxyManager/nginx-proxy-manager
Upstream iphash
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.2k
- Forks
- 3.9k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 20
Description
Is your feature request related to a problem? Please describe.
"Problem" is that when I want to use load balancing, I'm expected to edit the nginx.conf file, and save it outside of the docker container to make sure the changes aren't overwritten after each upgrade. This then breaks other things.
Describe the solution you'd like
If possible, it would be amazing to have the option to add an upstream ip hash within the NPM web interface that saves to a separate location than the nginx.conf file but can still be referenced in said conf file. This would hopefully allow creating load balancing in a more permanent way without causing future breaks.
Describe alternatives you've considered
I have for essentially my entire time using NPM, used the custom nginx.conf file, though this recently broke due to an upgrade attempted that changed a log file name. I think maybe having a file referenced in nginx.conf under the http {} that allows us to add an upstream ip hash later, have it stored outside the container like most of the custom proxy hosts and ssl certs, then create an interface for load balancing to simplify the creation of these load balances in a tab under the admin web portal inside of settings or somewhere like this, and even adding easy access to select the load balance IP hash in question as a destination for proxy hosts.
Additional context
for reference, this is the only change made to my nginx.conf file:
http { # All of the rest of this section is untouched, so I will only provide the line before and after my change:
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
upstream HighAvailabilityFailover {
ip_hash;
server localIP1:port;
server localIP2:port;
server localIP3:port;
}
include /etc/nginx/conf.d/include/log-proxy.conf;
}
I then call proxy_pass https://HighAvailabilityFailover from my Custom Nginx Configuration to ensure access to whichever server is currently up and running with the least local traffic.
I am not familiar enough to code this myself, but the hope would be, a file could be referenced here that the upstream hash could be added to via settings, to bypass the need for keeping a static nginx.conf. This would help for people who have several servers in a cluster to ensure up-time and high availability fail-over is accessible.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The request names nginx.conf, /etc/nginx/conf.d/include/log-proxy.conf, and the Custom Nginx Configuration entry point; begin by tracing how those configuration locations are generated and persisted. Then map the admin web interface flow for proxy-host destinations and determine where an upstream definition and ip_hash selection would belong. Done means the upstream can be managed outside the container, referenced by proxy hosts, and survives upgrades without editing nginx.conf.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, nginx, typescript
- Domain
- devops, full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100