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证书-腾讯云开发者社区-腾讯云

相关推荐
阳洞洞1 小时前
https和http有什么区别
网络协议·http·https
孙克旭_3 小时前
day045-nginx跳转功能补充与https
linux·运维·nginx·https
云游3 小时前
通过HTTPS访问Harbor2.13.1 的配置
https·harbor
you秀5 小时前
HTTPS通信流程:SSL/TLS握手全解析
网络协议·https·ssl
2501_915921437 小时前
iOS IPA 混淆实测分析:从逆向视角验证加固效果与防护流程
websocket·网络协议·tcp/ip·http·网络安全·https·udp
2501_915918417 小时前
打造可观测的 iOS CICD 流程:调试、追踪与质量保障全记录
websocket·网络协议·tcp/ip·http·网络安全·https·udp
好奇的菜鸟8 小时前
如何在 Ubuntu 24.04 (Noble) 上使用阿里源
linux·运维·ubuntu
小菜鸡952710 小时前
http、SSL、TLS、https、证书
http·https·证书·ssl·tls
泡泡以安10 小时前
安卓高版本HTTPS抓包:终极解决方案
爬虫·https·安卓逆向·安卓抓包
RW~10 小时前
Minio安装配置,桶权限设置,nginx代理 https minio
运维·nginx·https·minio