Cloudflare で Github ページの https を有効にする

Github ページは現在、カスタム ドメイン名を使用するブログの https をサポートしていません。そこで、CloudFlare が役に立ちます。

Simple steps and instructions

  • Register cloudflare account and add your custom domain;
  • Go to domain registrar site and change dns servers to what cloudflare provides;
  • Migrate dns resolving records to cloudflare (from previous/old domain registrar site);
  • Ensure ssl setting is set to "Flexible SSL" on cloudflare setting;

Post-procedures

  • Modify github pages "_config.yml" (e.g. jekyll powered)
url: https://your-domain-name   # with the https protocol
enforce_ssl: your-domain-name   # without any protocol
  • Create cloudflare page rules to redirect http to https
$ http://*your-domain-name/*
$ => always use ssl
  • Update static resources (css/js/html/image/etc) to use https url

参考文献

ssl