跳到主内容
大鹏云 大鹏云 DAPENG CLOUD
首页 · 帮助中心 · 服务器专区 · 使用 Let's Encrypt 申请免费 SSL 证书

使用 Let's Encrypt 申请免费 SSL 证书

Let's Encrypt 提供 90 天免费 SSL 证书,配合 Certbot 可自动申请与续期。前提:域名已解析到本机 IP,且 80 端口公网可达。

安装 Certbot

sudo apt update && sudo apt install -y certbot python3-certbot-nginx

CentOS 先装 EPEL 源再装同名包。

申请证书

sudo certbot --nginx -d example.com -d www.example.com

按提示输入邮箱并同意条款,Certbot 自动完成验证、签发并改好 Nginx 的 HTTPS 配置。

验证自动续期

Certbot 已注册定时任务自动续期,测试:

sudo certbot renew --dry-run

standalone 模式

不用插件时先停止占用 80 端口的服务,再执行:

sudo certbot certonly --standalone -d example.com
提示:申请失败多为域名未解析或 80 端口被防火墙拦截,请先确认后重试。
这篇文章对你有帮助吗?