r/nginxproxymanager • • 1d ago

A tool to sync npm

I recently added a second machine to my homelab and started using 2 instances of Adguard Home on both one master and one backup and was using Adguard sync to help with that. I thought to my self can I do that with npm? But how? Like you can only have one IP for the reverse proxy?

I discovered keepalived and basically it was down to have a sync solution like Adguard Home to sync between the two instances. I didn't find a solution quite like adguard sync so I created one.

https://github.com/ToYoNiX/nginx-proxy-manager-sync

Due to limitations of the api, I can't sync tokens so certs are basically copied to the new instance. At the moment it can pull from a master and push to a backup and it works really good. Apparently if you searched google for Nginx Proxy Manager Sync it will recommend this project.

I hope it helps!

2 Upvotes

4 comments sorted by

1

u/xylarr 18h ago

I just rsync everything between from my primary instance to my secondary instance.

I do have to stop both instances, but it's only down for a few seconds.

1

u/ToYoNiX 18h ago

With npm? I know it is a valid solution but the problem with it is with npm you can reload nginx from inside the npm container but npm uses a database to track proxy hosts so if I am understanding correctly restarting npm reloads nginx and updates the db? Or am I missing something?

1

u/xylarr 17h ago

I use a Docker implementation of npm. I copy the database file and other files over. Basically everything in the mounted volume.

1

u/ToYoNiX 17h ago

Got it. You can check out my project and give me a feedback if you have time I would really appreciate it. It is designed to run next to docker instances so you can take down the backup one keep it so you can go back to the old setup if you didn't like the new one then install a clean instance and run the sync from the main one to that clean instance. Also there is no downtime when syncing.