Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

A while back I wrote about how to fix the DNS records could not be found error in Google App Engine. Well it turns out, depending on your app.yaml settings and the rest of your certificate configuration, you could end up introducing an ERR_TOO_MANY_REDIRECTS loop for your website in a web browser. This is a simple thing to fix too, here's how.

This post is largely thanks to Egidio Caleiro Santoro and his comments on my earlier blog post.

If you have your CloudFlare security setting (SSL/TLS tab) set to Full or Full (Strict) and your app.yaml handler has secure set to always e.g. "secure: always", a redirect loop can arise. A temporarily workaround is to set secure to optional until you resolve these redirection issues.

In the above case a redirect loop should not typically occur since CF will contact your origin server using HTTPS, with secure set to always, GAE will respond over HTTPS too, no redirects are done. However if some of the old settings and DNS entries are still not in effect, redirections to HTTP could occur at some point in the communications.

CF has a good article explaining how to remove these redirect loops. Whenever dealing with DNS changes, it's always a good idea to wait 24-48 hours for all configurations to propagate (yes it should be quicker but sometimes waiting is the only option). At that point both CF and GAE security settings should be set to Full and always, respectively.


A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.