Visitors: reload later or clear cookies for the site (large cookies can trigger it). Site owners: check origin error logs at the time of the 520, look for crashes, resets, empty responses or response headers over 16 KB, and make sure firewalls aren't dropping Cloudflare.
What Error 520 means
A 520 means the origin answered, but not with a valid HTTP response. Crashing app processes, connection resets from security modules, and very large cookies/headers are the common causes.
How it shows up
- Cloudflare page: “Error 520. Web server is returning an unknown error”.
What causes Error 520
- Origin application crash or empty response.
- Connection reset by server firewall.
- Response headers too large.
- Origin misconfiguration.
How to fix it, step by step
- VisitorsReload; clear the site's cookies; try later.
- Check origin logsWeb server and app logs at the exact time; look for crashes or resets.
- Header sizeKeep request/response headers and cookies well under Cloudflare's limits.
- Firewall rulesAllow Cloudflare IPs; check mod_security or similar for blocks.
- Bypass testTemporarily pause Cloudflare (or use a hosts file to hit the origin) to see the raw error.
How to confirm the fix: Requests return normal pages without 520.
Keeping it from coming back
Monitor origin errors and keep cookies small.
