Use acme.sh to auto sign https certs from Lets Encrypt.
Related article: https://imququ.com/post/letsencrypt-certificate.html
This project use script from https://github.com/Neilpang/acme.sh
git clone https://github.com/alienhjy/letsautoencrypt.git
cd letsautoencrypt
makepkg
sudo pacman -U letsautoencrypt-*.pkg.tar.xz
Install letsautoencrypt.
Edit /etc/letsautoencrypt/env.conf, add your domains to SubjectAltName
according to the given format. Change NGINX_INCLUDE_CONF
, and make sure ${NGINX_INCLUDE_CONF}
is under your nginx conf dir.
Edit your nginx config file, add include https-acme.conf;
to the http sesson of nginx. Do not reload nginx now.
Run:
systemctl daemon-reload
systemctl start letsautoencrypt.service
systemctl start letsautoencrypt.timer
systemctl enable letsautoencrypt.timer
For update domain list, just update SubjectAltName
in /etc/letsautoencrypt/env.conf, then:
systemctl start letsautoencrypt.service
Stop your http server which listening port :80.
Edit /etc/letsautoencrypt/env.conf, add your domains to SubjectAltName
according to the given format.
Run:
## replace ${INSTALL_DIR} to your letsautoencrypt dir.
${INSTALL_DIR}/letsautoencrypt.sh
Add ssl config to the config file of your http server.
ssl_certificate => /var/lib/letsautoencrypt/acme/yoursite.com/fullchain.cer
ssl_certificate_key => /var/lib/letsautoencrypt/domain.key
Then, reload or restart your http server.
For update domain list, just stop your http server, and update SubjectAltName
in /etc/letsautoencrypt/env.conf, then repeat step 3 and step 4.