How to Fix Cloudflare Error 520 (Web Server Returned an Unknown Error)

Quick answer
Cloudflare error 520 means the website's origin server sent an empty, unknown or unexpected response to Cloudflare. Visitors should wait and retry; site owners should check server logs, firewall rules blocking Cloudflare IPs and header size.
What does “520 Web Server Returned an Unknown Error” mean?
520 is a Cloudflare-specific code, not an official HTTP status.
What causes it?
- Origin server crashed or reset the connection
- Firewall blocking Cloudflare IP addresses
- Headers or cookies too large
- Empty response from app
Steps to try
Stop when the issue is resolved.
- Visitors: reload after a few minutes.
- Site owners: check the origin server is running.
- Allow Cloudflare IP ranges in the server firewall.
- Check error logs for crashes at the same time.
- Reduce very large cookies or headers.
Need more support? Check the official help: MDN Web Docs: HTTP response status codes
FAQs
Is 520 Cloudflare's fault?
Usually the origin server is the cause, not Cloudflare.
What are 521 and 522?
521 means the origin refused the connection; 522 means it timed out.
By Ava Collins
·