Ubuntu nginx let‘s encrypt免费 https 设置

1.安装配置证书

apt-get update

apt-get -y install certbot

apt-get -y install python3-certbot-nginx

certbot --nginx

2.注意事项

1.保证服务器可域名访问,certbot需要验证 txt 记录。

2.同时要保证nginx 已配置 80端口的域名,否则提示

Could not automatically find a matching server block for secure.o3i.international. Set the server_name directive to use the Nginx installer.

server { listen 80;

server_name o3i.international;

access_log logs/ o3i.international.access.log main; r

oot /var/www/ o3i.international/htdocs; }

3.certbot会自动修改 nginx 的配置文件,原来 80 端口不能被访问了,443 端口可访问了。

80 会跳 443,但是nginx如果是 代理接口,要配置两个 server 分别占用 80,443。保留 80

4.自动续期:

sudo certbot renew --dry-run

如果测试成功,Certbot 会自动配置系统定期运行证书续期。通常情况下,Certbot 会自动将续期命令添加到系统的任务调度器中,确保证书在过期前得到更新。

5.阿里云服务器要开启 443 端口

参考文档

使用Certbot工具来申请和管理Let's Encrypt证书-腾讯云开发者社区-腾讯云

相关推荐
神筆&『馬良』2 小时前
Foundation_pose在自己的物体上复现指南:实现任意物体6D位姿检测(利用realsense_D435i和iphone_16pro手机)
目标检测·ubuntu·机器人·视觉检测
liuniu08184 小时前
VMware虚拟机安装ubuntu2022
ubuntu·ros
xfddlm5 小时前
边缘计算_ubuntu环境下使用瑞芯微RK3576NPU推理LLM
人工智能·ubuntu·边缘计算
EHagSJVNpTY5 小时前
MATLAB 中基于最大重叠离散小波变换的心电信号处理探索
ubuntu
.小墨迹6 小时前
apollo学习之借道超车的速度规划
linux·c++·学习·算法·ubuntu
技术路上的探险家7 小时前
Ubuntu下Docker与NVIDIA Container Toolkit完整安装教程(含国内源适配)
linux·ubuntu·docker
全栈工程师修炼指南7 小时前
Nginx | stream content 阶段:UDP 协议四层反向代理浅析与实践
运维·网络·网络协议·nginx·udp
无证驾驶梁嗖嗖8 小时前
用Plex打造随身私人影院告别影音杂乱,必须加上cpolar突破地域限制!
ubuntu
鹏北海8 小时前
micro-app 微前端项目部署指南
前端·nginx·微服务
Sheep Shaun8 小时前
揭开Linux的隐藏约定:你的第一个文件描述符为什么是3?
linux·服务器·ubuntu·文件系统·缓冲区