xiaowei-system/skills/devops/devops-umbrella/references/gaokao-site/dns-https-debugging.md

40 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# HTTPS 访问失败排查路径
> 日期2026-06-18
> 场景:用户反馈网站 HTTPS 打不开,但服务器本身在线
## 排查顺序(从外到内)
```
1. 域名 DNS 解析
curl -I https://www.yijiedeng.cn
↓ 若 "Could not resolve host" → DNS 问题,不是服务器问题
2. 直接 IP 访问(绕过 DNS
curl -Ik https://192.144.179.11/
↓ 若返回 200 → 服务器正常,问题在 DNS 域名配置
3. 腾讯云安全组检查
确认 443 入站规则允许 0.0.0.0/0
4. 服务器 nginx 状态
ssh root@192.144.179.11 'systemctl status gaokao-chat --no-pager'
```
## 本次案例
- 症状:`www.yijiedeng.cn` HTTPS 访问失败
- 诊断:`curl -I https://www.yijiedeng.cn` → `Could not resolve host`
- 验证:`curl -Ik https://192.144.179.11/` → `HTTP/1.1 200 OK`
- 根因:域名注册商处 `www` 子域名未配置 A 记录,或 DNS 传播未完成
- 解决:检查域名 DNS 管理面板,确保 `www` A 记录指向 `192.144.179.11`
## 常见模式
| 症状 | 根因 |
|------|------|
| `Could not resolve host` | DNS 未解析 / 传播中 / 子域名 A 记录缺失 |
| `Connection refused` | 安全组封锁 443 / nginx 未监听 443 |
| `SSL handshake failed` | 证书过期 / 证书与域名不匹配 |
| `Connection reset by peer` (SSL/TLS handshake 阶段) | **ICP 备案审批中DNSPod 拦截域名**确认方法certbot 报错含 `dnspod.qcloud.com/webblock.html` |
| IP 直接访问正常,域名失败 | DNS 问题(最常见:漏配 www A 记录)或 ICP 备案拦截 |