mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #1884] Automatic self-signed certificate renewal #1377
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#1377
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SBado on GitHub (Feb 23, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1884
Not really an issue, I just wanted to share my setup for self-signed certificate renewal. I'm using a combination of step-ca, acme.sh and a custom made script to automatically add and renew self signed certificates.
This is the script, I've called it npm-add-certificate:
This script will:
In case of a new certificate
In case of a renewed certificate
Assuming you already have a working instance of step-ca (doc) and you already added an ACME provisioner (doc), you can tell acme.sh to work with step (docs) and to call npm-add-certificate every time a certificate is issued and/or renewed.
So for example, if you want to add a certificate for example.mydomain.home, you can issue this command:
acme.sh --issue --standalone -d example.mydomain.home --server https://<yoour-step-ca-instance-hostname>/acme/acme/directory --ca-bundle $HOME/.step/certs/root_ca.crt --keylength ec-256 --post-hook /path/to/npm-acme-hook --renew-hook /path/to/npm-acme-hookWhere npm-acme-hook is a simple script which will call npm-add-certificate with the correct input arguments:
/path/to/npm-add-certificate -n $Le_Domain -c $CERT_FULLCHAIN_PATH -k $CERT_KEY_PATHYou will then find a new self signed certificate called "example.mydomain.home" in Nginx Proxy Manager. This certificate will be automatically renewed by Acme.sh and automatically updated in NPM by npm-add-certificate.
The code is not perfect, I'm not a bash ninja, but for my needs it's usable enough. If you have suggestions or you think you can do better, I'm all ears.
Obligatory warning: never trust a random script by a random guy found on the internet. Before using it, try to understand what it does and do a backup. I will not take responsibility for any harm done to you or your loved ones by this script.
Related issues: #1054 #301 #944, maybe others.
@github-actions[bot] commented on GitHub (Feb 23, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@github-actions[bot] commented on GitHub (Apr 8, 2025):
Issue was closed due to inactivity.