- Make sure you have registered your domain.
- Sign up for CloudFlare and create an account for that domain.
- In your domain registrar's admin panel, point the nameservers to CloudFlare's.
- From the CloudFlare settings for that domain, enable SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification, which is a pretty cool feature if you don't want/have a build step for that.)
- On GitHub create a new repository to store all the site (preferably in the form of static web pages and assets, though for the A-Frame site we use something called Hexo - not necessary though, YMMV).
- Create a CNAME record to point aframe.io to aframevr.github.io. (See https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/.)
- In your repo, create a file called
CNAMEcontaining the domain name (e.g.,aframe.io). - Push to GitHub Pages (either by pushing to
gh-pagesof some ordinary repo; or you can use themasterbranch of a repo named after<org>.github.io- example: https://github.com/aframevr/aframevr.github.io/ automatically gets published to https://aframevr.github.io/) - All content served to users is served from CloudFlare, originally served from the Fastly CDN (for initial page requests/cache misses), which is what every GitHub Pages asset is served from.
-
-
Save nguyendat/434b2dcad991d58bc1c82ce9d44ec66a to your computer and use it in GitHub Desktop.
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment