Configure https for websites through CloudFlare

This site is hosted on Github Pages and built using Hexo. The original domain name is , there is Github’s SSL certificate, but after pointing to the custom domain name, the certificate’s URL is not matched and becomes HTTP access. CloudFlare was finally used as a proxy to successfully open HTTPS for the whole station.


  1. Purchase a domain name
  2. Register to [CloudFlare] (, step by step, and point the DNS service provided by the domain name service provider to CloudFlare.
  3. Configure it. It is recommended to enable Always Use HTTPS in Page Rules and HSTS in Crypto.

The domain name was bought at [GoDaddy] ( GoDaddy’s DNS service is too slow, so it was originally hosted on [DNSPod] ( /). CloudFlare’s service is now used, so the DNS is moved from DNSPod to CloudFlare. The free plan is sufficient and the speed is good. Although the transmission between Github and CloudFlare is still insecure, CloudFlare and the visitor have successfully used HTTPS.

Domain name provider, instead point to


Then set the CNAME of DNS in CloudFlare and point www to If you have previously set up a custom domain name for Github Pages at another domain name provider, CloudFlare will automatically set the CNAME and root directory configuration, which is very user-friendly.