首先确认网站部署完成,已经能通过80端口访问

安装certbot

sudo apt install certbotsudo snap install --classic certbot

执行

sudo certbot --nginx

  • 如果出现如下提示:
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    The requested nginx plugin does not appear to be installed
    安装这个包解决:
    apt install python3-certbot-nginx

第一次执行需要填个邮箱来注册,所有步骤如下

// 1. 输入你的邮箱
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)(Enter 'c' to cancel): xxx@xxx.com   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 2. 是否同意服务条款,输入y
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 3. 是否同意接收推送邮件,输入y或n
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n
Account registered.Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: xxxxx.com
2: yyyyy.com// 4. 选择给nginx配置中的域名添加证书,输入序号选择,或直接回车选择所有
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for xxxxx.comSuccessfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/xxxxx.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/xxxxx.com/privkey.pem
This certificate expires on 2022-08-01.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for xxxxx.com to /etc/nginx/sites-enabled/xxxx
Congratulations! You have successfully enabled HTTPS on xxxxx.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:* Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate* Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 5.结束,可直接访问https站点

手动更新证书

sudo certbot renew

证书有效期为3个月,默认到期前会自动更新,修改配置后需手动更新

ubuntu使用certbot给nginx添加ssl证书相关推荐

  1. nginx添加ssl证书认证

    让nginx支持ssl证书认证首先安装上openssl,然后执行以下命令: openssl genrsa -out sim.key 1024 openssl req -new -key sim.key ...

  2. certbot为NGINX配置SSL证书

    ubuntu16.04 官方文档 Let's Encrypt 是一个自动签发 https 证书的免费项目 Certbot 是 Let's Encrypt 官方推荐的证书生成客户端工具 1. SSH进入 ...

  3. nginx添加ssl证书

    nginx加入如下配置 server {listen 443 ssl;server_name yourdomain.com; #需要将yourdomain.com替换成证书绑定的域名.ssl_cert ...

  4. 在不禁用iis的情况下停止其对443端口的禁用(由于443端口被占用宝塔nginx服务器添加ssl证书失败,又不能停止iis服务的解决办法)

    在不禁用iis的情况下停止其对443端口的禁用(由于443端口被占用宝塔nginx服务器添加ssl证书失败,又不能停止iis服务的解决办法) 1.修改文件 2.重启服务器或iis服务 3.补充 (扩展 ...

  5. 域名解析、映射以及添加SSL证书

    域名解析.映射以及添加SSL证书 前提 # 你要有个半年及以上的服务器,因为域名需要实名备案,备案的时间差不多就要两三个月 # 本篇博客的内容很多配置都需要一点时间,不要着急 在阿里云购买一个域名 搜 ...

  6. Nginx:Nginx添加SSL实现HTTPS访问

    上一篇博文给大家介绍了Nginx的安装与运行: Nginx:Nginx安装与运行 今天博主给大家分享如何给Nginx添加SSL,实现HTTPS访问Nginx服务,但前提条件是你的服务器有SSL,博主是 ...

  7. 个人站点配置免费HTTPS证书、nginx配置ssl证书、阿里云盾和站长之家两种

    原文链接:https://www.aiprose.com/blog/20 相信大家都想让自己的站点支持https,今天就给大家介绍如何在个人站点中使用https,并使用nginx配置ssl证书.我们可 ...

  8. 手机登录群晖出现ssl证书不可信_群晖WEB添加SSL证书实现HTTPS访问

    本篇文章禁止转载,谢谢~ 群晖WEBStation是一个扩展性非常强大的应用,它可以做导航.建网站.做博客.甚至能做图床,目前本博客数据和图床,就是建立在又拍云和家里的群晖之上的.又拍云做主仓,群晖做 ...

  9. Nginx配置SSL证书(CentOS环境),实现https请求

    目录 一.Nginx配置SSL 1.证书申请 二.配置SSL 2.1 证书上传 2.2 HTTPS server配置 2.2.3 配置转发 三.配置问题 四.配置示例 1.nginx.conf配置SS ...

最新文章

  1. SAP WM Storage Type Search配置里的Storage Class WPC标记
  2. vmware horizon view 添加vcenter server
  3. a元素生成多个a的问题,元素标签结尾影响
  4. 电脑网络禁用了怎么恢复_网卡禁用怎么启用恢复
  5. 潜行者活动硬盘电脑,你也可以打造
  6. GRUB2 管理器—Grub Customizer
  7. rs232 python_利用python发出rs232信号
  8. Web前端遍历对象应该如何操作呢?
  9. 0913作业(冒泡排序、二分查找法、模拟摇乐游戏)
  10. ZTree的全选 反选 全不选 取消 清空
  11. 第三届“信息论与编码”中大论坛诚邀您的参加
  12. idea @value提示_IDEA 中springboot 项目使用 注解Autowired 出现红线
  13. Angularjs 观察者模式 理解
  14. heartbeat双机热备配置(适用centos6\rhel6)
  15. 【软件工程导论】可行性研究
  16. opencv _rect
  17. PHP之SimpleXML函数
  18. 思科模拟器:网络安全实验
  19. BAT 批处理的注释语句
  20. Nginx教程之Rewrite语法规则和开源网站程序伪静态规则详解

热门文章

  1. 软件测试工程师面经2022-1-22
  2. vivado快捷键设置 放大代码_【Vivado那些事】Vivado中常用的快捷键(二)其他常用快捷键...
  3. linux 1060显卡,Ubuntu 16.04 安装 NVIDIA GeForce GTX 1060 显卡驱动,以及 CUDA 10.1
  4. 业务架构师如何进阶成长
  5. Zabbix主页应用介绍
  6. Python Django 学习 (二) 【Django 模型】
  7. CameraPath插件使用
  8. Matlab 2014a 安装
  9. iOS 【奇巧淫技】获取webView内容高度
  10. 奥赛 兔子繁殖 c语言,兔子繁殖问题(斐波拉契)