Update: GitHub is now working with Let’s Encrypt to support HTTPS for custom domain
Simple adding at least one A record pointing the domain to any of the following:
Nginx reverse proxy server
Instead of using CNAME as suggested by GitHub Help, I setup an Nginx reverse proxy to serve all the contents from GitHub repository.
Redirect all traffics to HTTPS
Add SSL certificate
My 443 port is used by sslh for multiplexing, therefore 8443 is set as HTTPS port. Adding Let’s Encrypt certificate to the configuration, and done!
The only down side is that your GitHub Pages doesn’t redirect to your domain, but the rest will work just the same.
But why all the hassle? Isn’t there a server you already have?
You get version control out of the box, updating the site is just commit and push. You don’t need to run a database, which unleashes your server to do something else while GitHub is taking care of your sites.
With the great flexibility and availability offered by GitHub, it’s unlikely your sites will produce error 4xx/5xx. Together with CloudFlare’s Always Online feature, your site will never go down, isn’t that cool?