Secure your GitHub Pages site with CloudFlare — Enforce HTTPS
GitHub Pages is one of the best ways to host your public static HTML sites.
GitHub allows you to use custom domains for your GitHub Pages and explains how to set it up on this page. However, GitHub does not automatically enforce your visitors to the HTTPS protocol.
When I reached the Custom Domain section from the Settings > Pages page, I saw that the Enforce HTTPS option was not selectable.
Here I got the error “Unavailable for your site because your domain is not properly configured to support HTTPS”. When I checked my CloudFlare DNS settings, everything seemed correct.
I found that when I turned off CloudFlare’s DNS Proxy, GitHub Actions automatically recognized this change and started provisioning the TLS certificate.
After about 15 minutes, the Enforce HTTPS option became available and I successfully enabled it.