Cloudflare Error 520: Web Server Returned an Unknown Error
Cloudflare connected to your origin, but the origin returned an empty, unknown or invalid response.
Web server is returning an unknown error Meaning
520 is Cloudflare’s catch-all for “the origin answered with something I can’t use” — the connection reset, the response was empty, or headers were invalid/too large. It’s an origin problem, not a Cloudflare outage.
Common causes
- Origin application crashed mid-response
- Response headers exceed Cloudflare’s 128 KB limit (huge cookies)
- Empty response or connection reset by origin
- Firewall on origin resetting connections from Cloudflare IPs
- Invalid HTTP response from the application
⚡ Quick fix
- Check origin web server and app logs at the time of the Ray ID
- Temporarily pause Cloudflare (or hit origin IP directly) to reproduce
- Reduce cookie/header size
- Allow-list Cloudflare IP ranges in the origin firewall
Detailed fix by platform
Cloudflare
- Collect the Ray ID from the error page; compare timestamps with origin logs. Ensure the origin isn’t rate-limiting Cloudflare IPs.
Code examples
Bypass Cloudflare to test origin
curl -svo /dev/null --resolve example.com:443:203.0.113.10 https://example.com/Replace 203.0.113.10 with your origin IP.
How to diagnose
- Origin logs — Errors at the Ray ID timestamp?
- Direct request — Does origin respond correctly without Cloudflare?
- Headers — Response headers/cookies too large?
- Firewall — Cloudflare IPs allowed?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Cloudflare
Other ways to find it
Where this error sits
Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026