使用前提
需要自己知道证书路径对应的是什么
Docker NginxProxyManager 使用
docker run --rm -itd -v /mnt/user/www/nginx/conf.d/ssl/certs:/acme.sh \
-e PUID=99 \
-e PGID=100 \
-e Ali_Key=xxxxx \
-e Ali_Secret=xxxxx \
--net=host --entrypoint /bin/sh --name=acme.sh neilpang/acme.sh;
docker exec acme.sh --set-default-ca --server letsencrypt;
domains=("*.xarr.cn")
dns_provider="dns_ali"
for domain in "${domains[@]}"; do
docker exec acme.sh --issue -d "$domain" --dns "$dns_provider" --force
done
for domain in "${domains[@]}"; do
cert_dir="${domain#*.}"
mkdir -pv /mnt/user/www/nginx/conf.d/ssl/certs/"$cert_dir"/nginx
chown -R nobody:users /mnt/user/www/nginx/conf.d/ssl/certs/"$cert_dir"
docker exec acme.sh --install-cert -d "*.${cert_dir}" \
--key-file /acme.sh/"$cert_dir"/nginx/privkey.pem \
--fullchain-file /acme.sh/"$cert_dir"/nginx/fullchain.pem
done
docker stop acme.sh
docker restart NginxProxyManagerNew
长亭雷池使用
acme.sh --install-cert -d xarr.cn -d *.xarr.cn --key-file /data/safeline/resources/nginx/certs/cert_2.key --fullchain-file /data/safeline/resources/nginx/certs/cert_2.crt --reloadcmd "docker exec safeline-tengine nginx -s reload"
正文完