How is 521 vs 522 determined?

From everything I read online including cloudflares own docs on 521 and 522 it seems that both can be achieved by the server being offline/down. If the server is offline/down how is it determined whether it's 521 or 522 then?
5 Replies
SuperHelpflare
SuperHelpflare3mo ago
Support AI
According to the Cloudflare documentation, both Error 521 and Error 522 can occur when the server is offline or down. However, the key difference lies in the specific circumstances that trigger each error. Error 521: Web Server is Down (https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-521/) occurs when the origin web server refuses connections from Cloudflare. This can happen when the server is offline or down, but it can also occur when the server is blocking or rate-limiting Cloudflare's IP addresses. Error 522: Connection Timed Out (https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-522/) occurs when Cloudflare times out contacting the origin web server. This can happen when the server is offline or down, but it can also occur when the server is taking too long to respond to Cloudflare's requests. In the case where the server is offline or down, Cloudflare's system will attempt to connect to the server and wait for a response. If the server does not respond within a certain time frame (typically 90 seconds), Cloudflare will return an Error 522. However, if the server is actively refusing connections from Cloudflare (e.g., due to IP blocking or rate limiting), Cloudflare will return an Error 521. In summary, the distinction between Error 521 and Error 522 when the server is offline or down depends on the specific behavior of the server. If the server is simply not responding, Cloudflare will return an Error 522. If the server is actively refusing connections from Cloudflare, Cloudflare will return an Error 521.
Feedback
Feedback has been submitted! Thank you :)
This is an AI generated response, it may not be 100% accurate. Please validate the output. You can ask followups by replying to this message or mentioning me.
funguyi
funguyiOP3mo ago
I'm not too sure I understand. If the server is down how can it refuse connections from cloudflare to make it an error 521?
Laudian
Laudian3mo ago
A 521 happens when the origin actively rejects the connection, while a 522 happens when either the TCP (19 seconds) or HTTP (90 seconds) connections time out.
funguyi
funguyiOP3mo ago
so it's safe to say the website isn't coming back up? I did report the website for abuse days ago and I'm hoping the host shut the website down
asuffield
asuffield3mo ago
there won't be any comment on abuse reports

Did you find this page helpful?