Cloudflare Error 520: Web Server Returned an Unknown Error

Share
Ongoing All Updated November 13, 2026Based on 3 user reportsHow we research

Quick answer

Error 520 means the origin sent an empty or unexpected response. Check origin crashes, oversized headers and cookies, HTTP/2 settings and firewall blocks.

Most likely fix: Rule out Cloudflare quickly

How to fix it

Try these in order — the most common fix is first.

  1. 1. Rule out Cloudflare quickly

    1. Set the DNS record to DNS only or pause Cloudflare
    2. If the site works, the origin response is the problem
    Did this fix it?
  2. 2. Check the origin logs

    1. Look for crashes, PHP fatal errors and blocked requests
    2. Allowlist Cloudflare IP ranges
    Did this fix it?
  3. 3. Clear oversized headers

    1. Clear cookies for the site and retry
    2. Reduce cookie size or count in the app
    Did this fix it?
  4. 4. Check HTTP/2 to origin

    1. Go to Speed > Settings > Protocol Optimization
    2. Disable HTTP/2 to Origin and retest
    Did this fix it?
  5. 5. Contact support with evidence

    1. Include URLs, cf-ray, output of /cdn-cgi/trace and two HAR files (with and without Cloudflare)
    Did this fix it?

Symptoms

'Error 520: Web server returned an unknown error' while the origin may work when Cloudflare is paused.

Why it happens

  • Origin crash or PHP application misbehaving
  • Firewall or security plugin blocking Cloudflare IPs
  • Request headers larger than 128 KB (too many cookies)
  • Empty or malformed responses
  • Incorrect HTTP/2 setup at the origin
  • Authenticated Origin Pull not matched at the origin

This guide also covers

  • cloudflare error 520
  • web server returned an unknown error
  • 520 error cloudflare nginx

Still not working?

If Cloudflare keeps failing, you're not alone. See every Cloudflare problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

Other Cloudflare errors

All 15 Cloudflare errors and fixes →