首先感谢 @romennts 给的教程
简单总结一下这个过程:
- 在 github page 的设置中填入 custom domain ,我的是 nevermoi.com
- 去 cloudflare 注册账号,成功后添加自己的域名
- 去你的域名注册商更改 dns server 成 cloudflare 所提供的
- 在 cloudflare 设置 A record ,参照: https://help.github.com/articles/setting-up-an-apex-domain/#configuring-a-records-with-your-dns-provider
- 在 cloudflare 配置 crypto ,选择 flexiable (这一步要一段时间才能起效)
- 在 cloudflare 配置 page rule ,一个是 always use https ,一个是 redirect http 到 https
每一步的操作可能需要 5-30 分钟才能起效
详细点的,带图文的看这个帖子: https://yicodes.com/2016/12/04/free-cloudflare-ssl-for-custom-domain/
最后又是贴 blog 时间了,骄傲的带着小锁: https://nevermoi.com