[GH-ISSUE #1575] Ability to inject rules on first startup? #1188

Closed
opened 2026-02-26 06:36:08 +03:00 by kerem · 3 comments
Owner

Originally created by @mckernanin on GitHub (Nov 9, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1575

Is your feature request related to a problem? Please describe.
I'm working on adding a simple docker-compose setup to an open source project, have previously used Traefik but NPM is very user friendly and for our use case, a better fit for our users. I'm trying to preconfigure everything that I can. I would like a way to inject some starter proxy routes into NPM.

Describe the solution you'd like
Very open to the actual solution. Could be an INIT SQL file for the DB, could be ability to import/export routes from the UI.

Describe alternatives you've considered
I'll investigate running an init container to setup the database on initial setup

Additional context

Originally created by @mckernanin on GitHub (Nov 9, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1575 **Is your feature request related to a problem? Please describe.** I'm working on adding a simple docker-compose setup to an open source project, have previously used Traefik but NPM is very user friendly and for our use case, a better fit for our users. I'm trying to preconfigure everything that I can. I would like a way to inject some starter proxy routes into NPM. **Describe the solution you'd like** Very open to the actual solution. Could be an INIT SQL file for the DB, could be ability to import/export routes from the UI. **Describe alternatives you've considered** I'll investigate running an init container to setup the database on initial setup **Additional context** <!-- Add any other context or screenshots about the feature request here. -->
kerem 2026-02-26 06:36:08 +03:00
Author
Owner

@mckernanin commented on GitHub (Nov 9, 2021):

I looked up the base container for maria, and it does support init sql from a directory: github.com/yobasystems/alpine-mariadb@5fa6982431/alpine-mariadb-amd64/files/run.sh (L74)

<!-- gh-comment-id:963782960 --> @mckernanin commented on GitHub (Nov 9, 2021): I looked up the base container for maria, and it does support init sql from a directory: https://github.com/yobasystems/alpine-mariadb/blob/5fa698243188d5abc879e3cc071578aec063b7ef/alpine-mariadb-amd64/files/run.sh?_pjax=%23js-repo-pjax-container%3Afirst-of-type%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%3Afirst-of-type%2C%20%5Bdata-pjax-container%5D%3Afirst-of-type#L74
Author
Owner

@chaptergy commented on GitHub (Nov 9, 2021):

Unfortunately there is currently no built-in way to do this. Populating the database is not enough, since the db is used to display the data in the admin ui, but changes in the db will not automatically be propagated to nginx. So when the api receives a request, the nginx config is generated and the db is updated, but the nginx and the db are not connected.

Here is how I would suggest doing this: Use the SQLite file instead of an external database and provide a pre-set-up SQLite file and some nginx config files to set up what you need, which can then be copied into the container using docker cp.

<!-- gh-comment-id:963969636 --> @chaptergy commented on GitHub (Nov 9, 2021): Unfortunately there is currently no built-in way to do this. Populating the database is not enough, since the db is used to display the data in the admin ui, but changes in the db will not automatically be propagated to nginx. So when the api receives a request, the nginx config is generated and the db is updated, but the nginx and the db are not connected. Here is how I would suggest doing this: Use the SQLite file instead of an external database and provide a pre-set-up SQLite file and some nginx config files to set up what you need, which can then be copied into the container using `docker cp`.
Author
Owner

@mckernanin commented on GitHub (Nov 9, 2021):

Ok thanks. Going to close this, I ended up deciding to just provide a walkthrough on how to setup NPM. If I really wanted it to be config driven, I'd go back to traefik

<!-- gh-comment-id:964619929 --> @mckernanin commented on GitHub (Nov 9, 2021): Ok thanks. Going to close this, I ended up deciding to just provide a walkthrough on how to setup NPM. If I really wanted it to be config driven, I'd go back to traefik
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1188
No description provided.