/ github

HTTPS on github pages with a custom domain

Since June 2016 setting up HTTPS on github pages has always been easy. However they have never supported custom domains. Here is how I resolved this problem.

Encryption is becoming the standard for the entire web, for many obvious reasons -- to the point that all browsers will require HTTP/2 requests to be encrypted and they will flag non secure sites with a (i) warning symbol.

Personally I wanted a nice green padlock and to take advantage of the performance improvements of HTTP/2 multiplexing and service worker support that requires being served over HTTPS. For more information on HTTP/2 I really enjoyed Ana Balica's talk at NDC this year go check it out here.

How I did it

  1. Make sure you have a registered domain name and have set it up appropriately in your github page repo.
  2. Sign up for CloudFlare and create an account for your domain. Instructions to how to do that are here.
  3. Determine your domain registrar and login to your registrar account.
  4. Update your nameserver records to the Cloudflare nameservers.
  5. From the CloudFlare settings for that domain, enable HTTPS/SSL or set SSL to Full depending upon the version of the portal you are using.
  6. Thats it! yoursite.github.io should now redirect to a secure yoursite dot com.

Cloudflare offers loads of great features as a content delivery network and its free! Please check it out here.

Thanks for reading, any questions please ask below.

HTTPS on github pages with a custom domain
Share this