certbot证书生成指令

1, 单个域名

certbot certonly --standalone -d static.xxx.io --non-interactive --agree-tos --email xxxx@qq.com --http-01-port=9999

2, 多个域名

certbot certonly --standalone -d static.xxx.io -d www.xxx.io -d contract-api.xxx.io -d static.xxx.io -d user-api.xxx.io --expand --non-interactive --agree-tos --email xxxx@qq.com --http-01-port=9999

自动更新脚本:

#!/usr/bin/env bash

# Renew the certificate
certbot renew --force-renewal

# Concatenate new cert files, with less output (avoiding the use tee and its output to stdout)
bash -c "cat /etc/letsencrypt/live/xxx.io/fullchain.pem /etc/letsencrypt/live/xxx.io/privkey.pem > /etc/ssl/certs/xxx.io.pem"

# Reload  HAProxy
systemctl restart haproxy

haproxy 配置:

acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl

backend letsencrypt-backend
   server letsencrypt 127.0.0.1:9999

手动生成:

sudo certbot certonly --manual -d example.com -d *.example.com

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容