Error 520: What it is & How To FIX [Solved 2022]

Error Reference number 520 is quite common and usually occurs when you receive an empty or unexpected response from the original server. According to the experts, 520 error mainly happens when the server can’t send a reply timely or inappropriately due to a resource-intensive process.

As this guide pertains to HTTP 520 error, and below, we will discuss how to fix “Web server is returning an unknown error or error code 520”. But before we start, some other vital considerations need your attention, and you must know about them.

So, let’s start with the causes of the Cloudflare 520 error, and then we will move on to our main topic:

What is error 520?

First, we would like to clear a misconception among the users. Remember that Cloudflare error 520 and HTTP 520 errors are the same. You will see this when Cloudflare gets null answer from the origin. When any software, cron job, or resource is utilizing extra resources than the limit, the server does not respond timely to all requests. And this results in “Error 520: Web server is returning an unknown error”.

What are the actual causes of error reference number 520?

The reason for this error are many, and we below you will find some of the most common causes of error 520.

  • When web server application stops or crashes.
  • Cloudflare doesn’t permit IPs at the origin.
  • The web server idle timeouts are less than 300 seconds.
  • When headers surpass Cloudflare’s size limit that is 8kb.
  • Null or improper reply from the server. Or response does include an HTTP status code.

How to fix the error 520?

Now that you know what causes the 520 error code let’s check out some quick remedies that you can use to fix error 520.

Learn more: How To Fix Error 522 

Disable Cloudflare.

The first thing that you should do when error 520 occurs is to disable Cloudflare. It is not difficult and can be done in many ways. The simplest way is, disable it from the home page. However, you can also disable it by turning off Cloudflare. And in some cases, you can also pause the Cloudflare feature.

Once Cloudflare turns off, start to search for the error logs and check out the details of the error for a further fix.

Try restarting the webserver.

Perhaps it is the main reason for the 520 error. Failure of the web server application may also result in HTTP error 520. When the webserver utilizes extra resources you will receive this error. There are many ways to manage the server’s resources, but you can restart the webserver to overcome the 520 error as an immediate fix.

Disable or remove plugins

Larger headers result in excessive use of plugins and utilize too many cookies. This results in too heavy headers, and in this case, Cloudflare cannot handle them efficiently.

So, try to remove unwanted and extra plugins one by one. If possible, remove all plugins and reinstall them.

Ensure your DNS is set accurately in Cloudflare

An empty or improper response from the server mostly occurs due to incorrect configuration of DNS on Cloudflare. Thus, we will advise you to recheck the current DNS settings to overcome error reference number 520.

Change Proxy Settings for Windows

To do this, follow these steps:

  • Go to the start menu.
  • Search for PC settings.
  • Now click on the advance settings.
  • Then lookout for the Network Settings.
  • You will see the ‘Change Proxy Settings’ tab here.
  • Now, you will see a Pop-up there.
  • Now go to the Connections tab and look for“LAN settings.”
  • Then tick on “Use a Proxy Server for this connection.”
  • After finishing the process, you can close the tab.

That’s it; you are good to go.

This is another simplest method to resolve the Cloudflare Error 520 problem.

Generate a HAR file

Another easy and the most common fix to resolve Cloudflare error 520 is by creating an HTTP Archive file (HAR). It is a request that goes to the web server’s origin via Cloudflare.

HAR files come in handy when you want to compare the response headers from the web server and from Cloudflare. You can also use it to confirm how large or heavy the header’s response is.

Wrap up

To conclude, fixing the 520 origin error is simple if you have some knowledge of the system, and you can follow the methods by yourself. All the tips and techniques discussed above are tested and verified by our Support Engineers, and you can follow these ways to fix the Web server is returning an unknown error message or error 520.