網站改善紀錄
HTTPS 憑證自動更新 — 改動摘要
背景
原本 nginx 只有 HTTP,Cloudflare 用 Flexible SSL(Cloudflare→VPS 明文)。 改成 Full (Strict),端到端全程加密。
改進
- Cloudflare→VPS 流量從 HTTP 明文改為 HTTPS 加密
- Let's Encrypt 憑證自動更新,不需手動管理
- 不綁定 Cloudflare,隨時可切換或移除 proxy
改動內容
docker-compose.yml
- nginx 掛載
letsencryptvolume(讀取憑證) - 新增
certbotservice(每 12h 自動 renew) - 新增
letsencryptnamed volume
api-server-axum/prod.conf
- port 80 改為 redirect → HTTPS
- 新增 port 443 SSL block
next-blog/prod.conf
- port 80 改為 redirect → HTTPS
- 新增 port 443 SSL block
nginx/cloudflare.ini(不進 git)
- Cloudflare API Token 設定檔
- certbot DNS-01 驗證用
shells/issue-cert.sh
- 首次取得憑證的腳本(部署後執行一次)
.gitignore
- 加入
nginx/cloudflare.ini
憑證資訊
- 域名:
kawa.homes,*.kawa.homes - 發行:Let's Encrypt
- 到期:2026-09-02(自動 renew)
- 驗證方式:DNS-01 via Cloudflare API