Google App Engine with Cloudflare - 522 error

I have a web app on Google Cloud - App engine, using a custom domain and a custom SSL (both on namecheap). As soon as I activate Cloudflare, I get 522 error with spikes in the response time of the website in some locations.

I went through this guide:
https://community.cloudflare.com/t/community-tip-fixing-error-522-connection-timed-out/42325
but it did not solve my issue.

Some additional info:

1 - Response time spikes disappear as soon as I pause Cloudflare, so this cannot be a temporary server problem or a load problem with App Engine;

2 - I have added all the Cloudflare IP ranges to the App Engine firewall:
https://www.cloudflare.com/ips/

I have an ‘allow’ rule for each one of them. I have checked that list multiple times to make sure I did not miss any of them.

Any suggestions on additional steps? Thank you.

It turned out there was an A record in my DNS list that was not required for my website. Deleting it fixed the issue!

1 Like