Cloudflare & edge errors

    Cloudflare Error 520: Web server returned an unknown error

    Also searched as: error 520 · 520 web server is returning an unknown error

    Is Cloudflare Error 520 happening on your domain?

    Probing the hostname externally and comparing against a direct origin request separates a Cloudflare-layer issue from an origin fault.

    Free, no signup. Runs from outside your network, which is the only way to tell a server fault from a local one.

    Short answer

    Cloudflare reached your origin and got back a response it could not interpret — an empty reply, a malformed header, or a connection dropped mid-response. The origin is up but misbehaving.

    What Cloudflare Error 520 means

    520 is Cloudflare's catch-all for 'the origin answered, but not with valid HTTP'. It is a symptom of the origin crashing, sending oversized headers, or resetting connections rather than a Cloudflare fault.

    Causes and fixes, most likely first

    most common

    The origin crashes or resets the connection mid-response.

    Check origin error logs at the exact timestamp. Memory-limit kills and PHP fatals produce this reliably.

    common

    Response headers are too large for Cloudflare's limits.

    Trim large cookies and verbose headers. Cloudflare enforces stricter header limits than most origins.

    common

    The origin returns an empty response with no status line.

    Reproduce by requesting the origin IP directly with the Host header set — bypassing Cloudflare shows the raw behaviour.

    How to stop it happening again

    • •Monitor the origin directly as well as the public hostname, so origin faults are visible before the edge masks them.
    • •Alert on 5xx rate rather than a single failed check — 520s are frequently intermittent.

    Frequently asked questions

    Is error 520 Cloudflare's fault?

    Almost never. It means Cloudflare could not make sense of what the origin returned. The evidence is in the origin's logs.

    Related errors

    Monitor this continuously with LemWatch

    A one-off cloudflare error 520 monitoring shows you today. LemWatch re-runs the same checks around the clock and alerts you the moment something breaks — free for up to 10 sites, no card needed.

    Last verified: by the Lemwatch research team.