
If you're behind Cloudflare and something breaks, you probably just see "5xx" and assume the server's down. But 521, 522, 523, 524, 525, and 526 are actually six different failure modes, and they point in completely different directions.
521 means your server actively refused the connection — it's off, crashed, or a firewall is blocking Cloudflare. 522 is a timeout, usually overload or a network problem on your end. 523 means Cloudflare can't even find your server — DNS or IP misconfiguration. 524 is the sneaky one: your server responded, just too slowly, often a slow DB query. 525 and 526 are both SSL failures, but for different reasons — missing/broken cert vs. a cert Cloudflare doesn't trust.
The annoying part is a basic up/down check can't tell these apart, so you end up SSHing in to figure out what generic monitoring already should've told you. Wrote up the full breakdown with what to check first for each one: https://webpixie.io/blog/post/cloudflare-5xx-error-codes-explained
Curious if others have a system for telling these apart quickly, or if everyone just wings it like we used to.