nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

High Availability solution with Nginx Proxy Manager

Open kamilkobak opened this issue 3 years ago • 6 comments

I tried to do a High Availability solution with Nginx Proxy Manager + Keepalived + inotify-tools but there is a problem with auto-reading configuration on the second NPM. NPM configuration is synchronized between hosts using inotify but to read it you need to restart NPM on the other host. Has anyone done HA for NPM? Maybe the solution would be to keep the configuration in the database.

kamilkobak avatar Oct 18 '22 10:10 kamilkobak

@kamilkobak do you want 2 NPM or one NPM and a second failover nginx, if so I guess that would be easier. Only requiring inotify to check on changes to parts of the data docker volume. Either way the second nginx will have to be reloaded and sometimes restarted depending on what was changed.

the1ts avatar Oct 19 '22 07:10 the1ts

HA is 2 NPM running at the same time and connections from outside are routed by 1 or 2 NPM depending on where the external IP will be assigned using Keepalived

kamilkobak avatar Oct 20 '22 12:10 kamilkobak

I don't think that can be done with simply sharing the data and database, how will each NPM know if the other has already done a piece of work? unless NPM is built to have this understanding from day one. Given its mission statement of being to "provide users with a easy way to accomplish reverse proxying hosts with SSL termination and it had to be so easy that a monkey could do it" I would think that NPM was not built with HA in mind. Also given how often letsencrypt has to be run, once successfully in a month period (NPM tries a renew from month 2 of the 3 month cert), my first point stands isn't nginx without NPM able to be HA in a much easier fashion now.

the1ts avatar Oct 20 '22 12:10 the1ts

I think just basic failover as an option would be great...inotify and keepalived. Alternatively, having this available as a non-docker install and letting people install inotify/keepalived themselves if they want to go that route would be a good option. It's reasonably well documented elsewhere and can keep the core of this project focussed on the NPM UI and experience while allowing people to simply mirror the configs.

BlindBadgerStudios avatar Sep 13 '23 14:09 BlindBadgerStudios

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Apr 24 '24 01:04 github-actions[bot]

I would 100% be in need of this. So far, NPM is running on my main Docker instance. I try to keep reboots and downtime to a minimum, but because it is also a testing environment for new containers, issues do happen, HA NPM would help a lot as I am transitioning everything from IP addresses to HTTPS URLs.

BigFlubba avatar May 19 '25 01:05 BigFlubba