HTTPS provides a layer of encryption that prevents others from snooping on or tampering with traffic to your site.
When HTTPS is enforced, your site will only be served over HTTPS. Learn more about securing your GitHub Pages site with HTTPS.
原因:用cloudflare解析DNS记录并开启了代理(Proxy),先取消代理即可。
运行命令:dig blog.00002000.xyz +noall +answer -t A
开启代理时:
blog.00002000.xyz. 600 IN A 104.21.82.3
blog.00002000.xyz. 600 IN A 172.67.167.86
关闭代理时:
blog.00002000.xyz. 300 IN CNAME seeu100.github.io.
seeu100.github.io. 3600 IN A 185.199.108.153
seeu100.github.io. 3600 IN A 185.199.109.153
seeu100.github.io. 3600 IN A 185.199.110.153
seeu100.github.io. 3600 IN A 185.199.111.153
报错如下: Enforce HTTPS — Unavailable for your site because your domain is not properly configured to support HTTPS (
00002000.xyz
) — Troubleshooting custom domainsHTTPS provides a layer of encryption that prevents others from snooping on or tampering with traffic to your site. When HTTPS is enforced, your site will only be served over HTTPS. Learn more about securing your GitHub Pages site with HTTPS.
原因:用cloudflare解析DNS记录并开启了代理(Proxy),先取消代理即可。 运行命令:
dig blog.00002000.xyz +noall +answer -t A
开启代理时:
关闭代理时:
使用Cloudflare的DNS解析服务时,如果启用了代理,那么原本直接指向GitHub Pages服务器的DNS解析记录将被替换为指向Cloudflare的CDN节点。这样虽然可以实现SSL/TLS加密,但由于Cloudflare与GitHub Pages之间没有建立正确的HTTPS连接配置,可能会导致GitHub Pages无法正确识别并强制启用HTTPS。
GitHub Pages仅能识别那些直接指向其IP地址或者经过正确CNAME映射的域名,而无法识别通过Cloudflare代理后的DNS记录,因此会出现“Enforce HTTPS — Unavailable for your site”的错误提示。
总的来说,使用Cloudflare的DNS解析服务时,要使GitHub Pages上的自定义域名支持HTTPS,请按照以下步骤操作: