Across all domains in my Cloudflare account I get occasional 502 HTTP errors

Across all domains in my Cloudflare account I get occasional 502 HTTP errors. Domains are on different servers, networks and configurations. Last week we detected that this happens only when the domain is proxied on Cloudflare. If we stop the proxy everything is ok. Any suggestions?