type
status
date
slug
summary
tags
category
icon
password
現在使用
Vercel
的託管服務時, 會自動加上 Let's Ecncrypt
的 SSL 憑證. 也就是說網站可以使用 https, 不用另外再申請 SSL. 但我想讓網站可以經由 CDN 傳播, 因此使用 Cloudflare
的 CDN 服務, 而它同時也有提供免費的 SSL 憑證.以下是我設定的步驟:登入後選擇新增加網站

填入 domain

選擇免費的方案

把這二個 DNS 存起來, 等一下要到
Namecheap
中設定.
進入
Namecheap
後,到 NAMESERVERS
選擇 Custom DNS
. 再填入 Vercel
的 DNS 
再回到
Cloudflare
按下 Check nameservers now

現在開始設定 DNS records, 如果按照之前 cname 的設定方式, 我們會得到
err_too_many_redirects
的錯誤. 這是因為 Cloudflare
到 Vercel
是使用 http, 但 Vercel
會 redirect 成 https, 然後再被 redirect 成 http. 

記得要設定
SSL/TLS encryption mode
為 Full

最後,再到
Vercel
加上 domain, 就完成整個設定
- 作者:fivewillow
- 連結:https://stream-notes.fivewillows.cc/article/ssl-and-cdn-for-website
- 著作權:本文採用 CC BY-NC-SA 4.0 許可協議,轉載請註明出處。