是否可以在具有自定义域的 GitHub 页面网站上使用 HTTPS/SSL?

Is it possible to use HTTPS/SSL on GitHub Pages sites with a custom domain?

有什么方法可以在使用自定义域的 GitHub 页面网站上使用 HTTPS/SSL 吗?建议使用 SSL 以获得更好的搜索引擎排名,除此之外还有很多其他用途。

GitHub 页面上的自定义域 支持 HTTPS/SSL:

GitHub Pages has supported custom domains since 2009, and sites on the *.github.io domain have supported HTTPS since 2016. Today, custom domains on GitHub Pages are gaining support for HTTPS as well, meaning over a million GitHub Pages sites will be served over HTTPS.

https://blog.github.com/2018-05-01-github-pages-custom-domains-https/

  1. 转到https://github.com/**username**/**repo**/settings

  2. 选中“强制 HTTPS”复选框:


2018 年 5 月 1 日之前,GitHub 页面仅在使用 *.github.io 域的网站上支持 SSL:https://help.github.com/articles/securing-your-github-pages-site-with-https/

现在可以在具有自定义域的 GitHub 页面网站上使用 HTTPS

If you are using CNAME or ALIAS records for your custom domain, you’re all set and your site should be accessible over HTTPS.

If you are using A records, you must update your site’s DNS records with new IP addresses. Please see our guide to setting up your custom domain with Pages and update any A records you might have set.

HTTPS 工作后:

You can optionally “Enforce HTTPS” for your domain in your repository’s settings, ensuring users who request your site over HTTP are upgraded to HTTPS.

您可以在此处阅读完整的公告:https://blog.github.com/2018-05-01-github-pages-custom-domains-https/