Contents
Cloudflare sits between visitors and your server as a proxy and CDN. When it asks your server for a page, it expects a proper HTTP response. With a 520 the connection happened, but what came back wasn’t something Cloudflare could use: a connection closed abruptly, an empty reply, or malformed headers. That’s why Cloudflare calls it “unknown”, and its page shows the browser and Cloudflare working while Host has failed.
What causes error 520
- A process crashing on the server: a PHP process or app died mid-response on a fatal error or memory limit, closing the connection with no reply.
- A firewall cutting Cloudflare’s connections: all your traffic arrives from Cloudflare IPs, so a security or rate-limiting tool may see it as heavy traffic from a few addresses and drop it.
- Oversized headers: too many cookies, or headers added by the app, beyond what Cloudflare accepts.
- An empty response from the app: a script that exits without output or a status code.
- Invalid HTTP headers sent by custom code or a plugin.
Fixing it as a visitor
It’s not your device. Try again in a few minutes, and if it keeps happening, send the site owner the URL and the Ray ID.
Fixing it as the site owner
- Test the server directly, bypassing Cloudflare. Find the server’s IP in cPanel (the General Information panel), then run:
curl -sv --resolve example.com:443:203.0.113.10 https://example.com/ -o /dev/null
Replace 203.0.113.10 with your server’s address. Or pause Cloudflare for a moment from the Overview page with Pause Cloudflare on Site.
- If the server fails directly too, the problem is the site itself. Open cPanel, then Metrics → Errors, look for an
error_logfile, and treat it like a 502 or 500 error. - If the server works directly but fails through Cloudflare, a firewall is probably cutting Cloudflare’s connections. Make sure your site’s security plugins don’t block Cloudflare’s IPs, and ask support to review any Imunify360 block.
- Shrink the headers: open the site in a private window. If it works there, too many cookies are the likely cause. Find the plugin writing large cookies and cut them down.
- Check resource usage in Metrics → Resource Usage, since processes ended by a memory limit can cut a response short.
- Collect evidence: note the time, the Ray ID and the direct-test result, and send them to support if you need help.
Prevention
- Configure security and rate-limiting tools to read the visitor’s real IP from the
CF-Connecting-IPheader rather than Cloudflare’s addresses. - Watch the error log after every plugin or code update.
- Keep cookies few and small.
On ArabyHost
With our nameservers ns1.arabicode.com and ns2.arabicode.com you don’t need Cloudflare, but you can use it if you like, with the A record pointing to the IP shown in cPanel. Sites run on LiteSpeed with Imunify360 protecting the server, and support can review any Imunify360 or ModSecurity block that hits Cloudflare’s connections. The Araby AI assistant can read your error log. See using Cloudflare with your hosting.
FAQ
Is error 520 Cloudflare's fault?
Usually not. The error page shows your browser and Cloudflare working; the problem is the response coming from your server. So the fix starts with the server and its logs.
How can I test my site without Cloudflare?
Use curl with --resolve to send the request straight to your server's IP address, or pause Cloudflare temporarily with Pause Cloudflare on Site on the Overview page.
What should I send support when I see a 520?
The URL, the time of the error with its time zone, the Ray ID at the bottom of the error page, and the result of testing the server directly without Cloudflare.