Github pages: proxies and redirects

Jul 2013

When I wanted to start a github pages blog, github was serving it's page requests on <username> These days, they service it on <username>, probably for security reasons (session cookies?).

Anyway, when I wanted my page to be at, my own domain name. I also wanted the same thing under, which is another domain name that is also my OpenID. So, I configured apache to just proxy my domains to the github page. Here is my config:

   ProxyPass /
   ProxyPassReverse /

This change made my openid inaccessible. I had my openid settings in my head. However, when I would sign in to my openid, stackoverflow would ask me if I wanted to create a new account for In fact, I realized that even though I was proxying, I would get redirected to in my browser.

Looks like the github web server only accepts requests on one hostname. You can tell it's just one because they say so here. So, I figured I could fix my problem by setting a custom cname page. I tried that, here.

This resulted in strange behavior. Even going to in my browser resulted in an infinite 301 redirect loop to!

This finally made me realize what was happening. I was proxying all requests to and should have been using Even requests to would go to, which is NOT the domain name in my CNAME file. Github would redirect away, and hitting that domain would again issue an improper sub-request.

To fix the problem, I removed my CNAME file and fixed my apache config to go to proxy to Suddenly, everything was magically working again!

Drop me a line! igor47@