I'm experiencing a strange issue with Cloudflare proxy and looking for some advice.
Symptom: When Cloudflare proxy (orange cloud) is enabled, my domain either throws a 522 connection timed out error or takes about 20 seconds to load. However, the moment I turn off the proxy (gray cloud / DNS only), the site loads instantly in about 100ms.
Cloudflare Edge Info: Checking `/cdn-cgi/trace` returns `colo=KIX` (Osaka, Japan), meaning Cloudflare's edge responds instantly, but the actual connection/request forwarding from Cloudflare to the origin server stalls.
Server Specs & Environment
- GCP(e2-standard-2) : CPU usage is extremely low (around 8%).
- RAM is sufficient.
- Stack: Nginx + Gunicorn.
- Keep-Alive timeout is set to 120s in Nginx.
Cloudflare Settings
- SSL/TLS mode is set to "Full".
Additional Context: I suspect it's probably *not* a firewall or blocking issue because:
1. It has been running smoothly for months without any issues, and this suddenly started happening yesterday/today.
2. Even though it takes a long time or throws 522, connections *do* eventually succeed sometimes (so it's not a hard drop or permanent block).
Why would turning on the Cloudflare proxy cause this massive 20-second delay / 522 errors while direct connection to the origin server is super fast? Any ideas or things I should check?
Thanks!