HTTP status code

520

Web Server Returned an Unknown Error

Cloudflare-specific: the origin returned something Cloudflare could not interpret.

What 520 means

A Cloudflare status code, not a standard HTTP one. Cloudflare connected to your origin server and received a response that violates HTTP — an empty reply, a connection reset, or malformed headers. It is the catch-all for "the origin did something inexplicable".

Common causes

How to fix it

Bypass Cloudflare and request the origin directly by IP with curl, sending the correct Host header. If the origin misbehaves without Cloudflare in the path, the problem is entirely yours. Check for oversized headers and look in the origin error log for the exact moment of a 520 — process-level crashes usually leave a trace.

Catching 520 before your users report it

A 520 means your site is broken for every visitor while your server may look healthy in local checks. External HTTP monitoring is the only thing that sees it.

Monitor for 520 responses free

Often confused with

← All HTTP status codes

520 Web Server Returned an Unknown Error — questions

Is a 520 error Cloudflare's fault?

Usually not. 520 means Cloudflare reached your origin and the origin returned something invalid. It is a report about your server, not about Cloudflare — though it only appears when Cloudflare is in the path.

How do I debug a 520?

Request the origin IP directly with curl, passing the correct Host header, so Cloudflare is out of the path. That immediately tells you whether the origin is the problem.

Know about 520 errors immediately

Pingura checks your endpoints from five regions and alerts on the status code, not just reachability.

Get Started Free