GitHub Pages Custom Domain HTTPS Configuration

This article introduces how to enable HTTPS for GitHub Pages custom domains, including the advantages, implementation details, and relevant resources. These steps can help improve efficiency when configuring HTTPS for GitHub Pages custom domains.

Feb 17, 2018 · 1 min read · 135 Words · -Views -Comments · Programming

GitHub Pages itself supports HTTPS. For example, repository addresses like alanhg.github.io can be accessed normally via HTTPS, but after using a custom domain, HTTPS access is not available. Here we use Cloudflare’s free CDN service to achieve this.

Operation Steps

  • Register a Cloudflare account

  • Click ‘Add Site’

  • Choose the free plan

  • After successful addition, it will prompt you to modify the domain’s DNS servers

  • Under Crypto, select SSL-Flexible

    Check Always use HTTPS

  • Log in to your domain registrar’s control panel, modify DNS server addresses to those provided by Cloudflare above

Final Thoughts

After configuration is complete, accessing https://1991421.cn works, but the browser will show a certificate error because it’s GitHub’s certificate, which doesn’t match our custom domain. This issue requires some waiting time. It worked normally for me when I accessed it the next day.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover