Nginx Unit plugin for Certbot
Project description
Certbot NGINX Unit plugin
This is a certbot plugin for using certbot in combination with NGINX Unit https://unit.nginx.org/
Requirement
The command unitc
should be installed and executable.
Current Features
- Supports NGINX Unit/1.31*
- Supports cerbot 1.21+
- install certificates
- automatic renewal certificates
Install
You have to install the plugin and configure the unit listener for port 80
# unitc /config
{
"listeners": {
"*:80": {
"pass": "routes"
}
"routes": [
{
"action": {
"share": "/srv/www/unit/index.html"
}
}
]
}
}
Now, you can generate and automatically install the certificate with
# certbot --configurator nginx_unit -d www.myapp.com
The result is a certificate created and installed.
# unitc /certificates
{
"www.myapp.com_20240202145800": {
"key": "RSA (2048 bits)",
"chain": [
{
<omissis>
}
]
}
}
and the configuration updated
# unitc /config
{
"listeners": {
"*:80": {
"pass": "routes"
},
"*:443": {
"pass": "routes",
"tls": {
"certificate": [
"www.myapp.com_20240202145800"
]
}
}
},
"routes": [
{
"match": {
"uri": "/.well-known/acme-challenge/*"
},
"action": {
"share": "/srv/www/unit/$uri"
}
},
{
"action": {
"share": "/srv/www/unit/index.html"
}
}
]
}
Auto-renew certificates
Certbot installs a timer on the system to renew certificates one month before the certificate expiration date.
Multiple domains/applications
You can run the certbot command for each domain
# certbot --configurator nginx_unit -d www.myapp1.com
# certbot --configurator nginx_unit -d www.myapp2.com
# unitc '/config/listeners/*:443'
{
"pass": "routes",
"tls": {
"certificate": [
"www.myapp1.com_20240202145800"
"www.myapp2.com_20240202145800"
]
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
certbot-nginx-unit-1.0.0.tar.gz
(19.6 kB
view hashes)
Built Distribution
Close
Hashes for certbot_nginx_unit-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcbc80f26fd2656f5d15b30d2b981408bccc6cd251250acfadb968498168c8fe |
|
MD5 | 039aede5b9fa32b1782160c69434a579 |
|
BLAKE2b-256 | cf3abb7b9a23a21b3770328f51a1eaa9a01a121398a0004a7ff9f66211fc4573 |