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 they include Cloudflare IPs on their allowed list.

  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. Disable Always Online and check to see if the error goes away or changes. If so, consult the appropriate 521 or 522 #CommunityTip.

  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
Getting Error 520 and 521
Error 520 for my website
Cloudflare and Ezoic issue, cant use Admin smoothly
Getting 520 error status code
Error 520 Web server unknown error
Error 520 Subdomain
520 errors and slow responses in Kyiv region
Error 524, 520
520 error when accessing my own site
Long runtime batch scripts, 520 Error and Page Rules
Website showing 520 error
How to Resolve 520 error
Godaddy and Cloudflare
Refresh/purge cache & flush the dns?
Getting an 520 error for website
Not connecting to host error 520
Unknown error with cloudfare and web server
Problema 520
How does visiting a website sometimes look like this?
No "Free" with SSL
Error 520 Web server issue
General Server Error 502 from UK
There are always errors on my website 503 and error 525 errors
error 520 web serve is returning unknown.
Cloudflare Access Issue
Error 520 - Please help
Error 520: Is Cloudflare responsible for this?
Error 520/525/502
Could not solve Error 520. Need help
Website giving error 520
Site doesn't work when DNS pointed to CF
Server 520 Error
How to fix erorr 520
Error 520 when updating wordpress plugins
There is an unknown connection issue between Cloudflare and the origin web server
520 error started today with cloudflare
Why can't I connect? Only on my pc
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
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
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
Error 520 on wp-admin pages
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
Permanent bad request due Safari OS X Catalina
Erro 520 após certificado SSL
Error 520: Web server is returning an unknown error GoDaddy
Web server is returning an unknown error
Opsikpro website problem
My IP is blacklisted on CloudFlare?
Need help to fix 520 error
520 Error not seeing the reason for this
Error 520 'Web server is returning an unknown error"
El error 520
Facing error 520
Error 525 & 520 - Why?
Error 520 - Cloudflare cache and origin server issue
Error 520 appears and goes in a NextCloud instance
About Error 520
Error code 520 in my subdirectory
Error 520 Web server is returning an unknown error - wordpress
Error 520 Web server is returning an unknown error - wordpress
Random 520 error
Error 520 persistente en drupal
Error 520 client side
Always 520
520 error after going to cloudflare
How do i resolve eror 520 on Cloudflare?