Cloudflare Error 520: Web Server Returned an Unknown Error
Cloudflare connected to your origin, but the origin returned an empty, unknown or invalid response.
Seen on:
Cloudflare
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
bash
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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026