Community Tip - Fixing Error 520: Web server is returning an unknown error

Try the suggestions in this Community Tip to help you fix “Error 520: Web server is returning an unknown error”.

Error 520 is essentially a catch-all response when something unexpected happens or when the origin server incorrectly interprets or does not tolerate a request due to a protocol violation or an empty response. A 520 error occurs when the connection started on the origin web server, but that the request was not completed. The most common reason why this would occur is that either a program, cron job, or resource is taking up more resources than it should causing the server not to be able to respond to all requests properly. When this happens, you’ll see “Error 520: Web server is returning an unknown error”.

Quick Fix Ideas

  1. Your web server or networking equipment, any http aware device like Firewall, Load Balancer, et al, reset the TCP connection after it was established. Sometimes when a web server crashes it will reset the connection. Check your web server error logs with your hosting provider for the time that the error occurred to see any error messages.

  2. Your web server returned an invalid response that exceeded our limits. Often this can happen if your web server is returning too many/too large headers. This is often caused by runaway scripts that return too many cookies, for example. The Code Igniter PHP framework has some known bugs around this, too.

  3. While you’re having a conversation with your hosting provider, make sure to white list Cloudflare IPs.

  4. While the 520 error can be triggered by unique and seemingly strange edge-case scenarios, they are generally caused by: Connection resets (following a successful TCP handshake), Headers exceed the Cloudflare header size limit (over 8kb), An empty response from origin, An invalid HTTP response, Missing response headers from an HTTP response, or the Presence of multiple Content-Length headers.

  5. Note that if Always Online is enabled, this error will trigger an Always Online page to be served.

  6. If this error is still happening, contact Cloudflare Customer Support and provide example URL(s) and Ray ID and output from a traceroute from any impacted user, copy the output of Also include two HAR file(s): one detailing your request with Cloudflare enabled on your website and the other with Cloudflare temporarily disabled - see How do I temporarily deactivate Cloudflare? These HAR files will be helpful in comparing server responses.

Lite Reading

Background Resources
Help Center

Research The Issue

If You Need More Help
This community of other Cloudflare users may be able to assist you, if not, login to Cloudflare and then contact Cloudflare Support. When you contact support, make sure to include as much of this information as possible: time stamped log files from your origin server, RayID, domain name, error messages, screen shots, and/or HAR file(s).

Expert Comments Appreciated
This Community Tip will remain open for input from Community experts and those familiar with this issue. We really appreciate comments that start with words like: “The three things I always try”, or “Do this first” or “In my experience”.

This is a Cloudflare Community Tip, to review other tips click here.

Çevirme…traduzir…翻译…traducir…Traduire…Übersetzen…:greyg: Translate this Tip

FXWSCT 101819

I suddenly got a 520 error
520 error when saving articles in Wordpress
Wordpress Errore 520
I don't accese to my site
I Bought SSL Dedicated but
Error 520 Web server unknown error
Geting Error 520 inside wordpress dashboard after conecting to Ezoic
Geting Error 520 inside wordpress dashboard after conecting to Ezoic
I can not access my website with enabled service
New to cloudflare. Please help on what to do to fix this issue
Access wordpress admin returning Error 520
Ukraine, Belarus and Russia Unable to access my site
Error 520 Ray ID: 4fb3444db842d61c
HTTP 520 Errors
When i tried to upload that file, i see this error:
HTTP 520 Errors
All websites in The Netherlands getting 520 & 522 error
Cloudflare causing 520 errors on multiple websites
The site is not working after using the nameservers of cloudflare
Erreur 520 inconnue
The site is not working after using the nameservers of cloudflare
Erreur 520
How to Report 520 Errors to Support
I removed my site from cloudflare but my site always Error 520 what should I do?
Error 520 - What's the solution?
Frequent 520 responses
Only one page returning 520
Community Tip - All Published Tips
Why can't I connect? Only on my pc
Loading site error, is it Cloudflare or my free hosting error?
ERROR 520 website return error
WordPress plugins
520 Error with WordPress Divi Builder
Wp-config.php error 520
Wp-config.php error 520
Error 520: Web server is returning an unknown error FastComet
Error 525 and Error 520
Error 520 All The Time!
MODx admin panel does not work
Error 520: Web server is returning an unknown error GoDaddy
Erro 520 após certificado SSL
Error 520 on wp-admin pages
Cloudflare and Ezoic issue, cant use Admin smoothly
Error 520 Ray ID: 566b9f73891ddd42 • 2020-02-17 23:44:19 UTC Web server is returning an unknown error
520 errors on some sites
Website is Down - Error 520
Changing my website theme
Site not load
Error 525 SSL failed
My server is down under 520 & Cloudflare Error 520 Cannot Login to Members Area. Sling support has no idea (Help)
Error 520 when visiting
Many Error 520
Getting Error 520 and 521
Cannot access log-in page/multiple IP addresses
Getting Error 520 whenever I try to update a Wordpress post
Community Tip - Helpful Links, on Display
Error 520 on editing post or pages
Error submitting support request
Error 520 for my website