There’s only 3 stpes to set up.

  1. Create CNAME file
    Create a file named CNAME that path should be /source/CNAME and field in your domain. In my case, it should be blog.codewalker.me. notice There would be no http:// or https:// etc.

    1
    2
    cat CNAME
    blog.codewalker.me
  2. Setup domain
    Setup you DNS to add a subdomain as CNAME to you GitHub pages domain.
    Refers mine, it should be blog.codewalker.me to codewalkertse.github.io

  3. Step 3 or not
    In my case, I should make codewalker.me redirect to blog.codewalker.me.
    In my Nginx Server the .conf should be like this:

    1
    2
    3
    4
    5
    6
    server {
    listen 80;
    server_name codewalker.me www.codewalker.me;
    rewrite ^/(.*) http://blog.codewalker.me/$1 permanent;
    access_log off;
    }

    To make all request redirect to blog.codewalker.me by 301 signal.

Have fun with hexo

I love this world

EOF