tutorials

How to Fix Cloudflare’s “Error 520: Web Server Is Returning an Unknown Error”

Share

What is Error 520?

A common mistake causing an empty or unexpected response to the original server is the Cloudflare 520 error. This is especially true that a resource-intensive procedure prevents the server from sending a prompt answer.

There are various other 5XX errors too, including the 502 bad gateway error, but they are highly different from one another in many ways.

When an empty, unknown or unexpected Cloudflare response is returned from the source server, the Cloudflare error 520 triggers. When more resources than a program, cron job, or resource are required, the Server may not be able to answer all requests correctly.

This produces the following: “Error 520: Web server is returning an unknown error.”

This mistake could be justified by:

  • The web server application source crashes: The web server application crash at the server source is one of the main causes of this problem. The most likely reason for this is the running of a resource-intensive script. As a consequence, the server cannot reply in a timely manner to requests.
  • No Cloudflare IPs allowed at the origin: the firewall of the original server may present an impediment when connecting to a non-whitelisted IP address. Therefore, if the IP address of Cloudflare is not whitelisted, the 529 error can occur.
  • The origin of the TCP idle web server takes less than 300 seconds: A network connection is set up and maintained through the TCP protocol. The unknown error can be caused if its timeout value is too low.
  • Headers above the header size limit of Cloudflare (8kb): The immense use of cookies or the use of large cookies increases headers’ size. Crossing the memory limit also causes other errors apart from 520 errors, including Since the header limit of Cloudflare exists at 8kb, the header cannot be processed.
  • Empty reply from a web server that lacks an HTTP status or reply body: this is usually done when the domain DNS points to a faulty server.

Fixing the 520 Error:

Here are the most effective steps that you must follow in order to resolve this error.

Fix 1: Disabling the Cloudflare.

Cloudflare must be disabled before you start troubleshooting. This helps isolate the problem by verifying that the problem is recreated without a factor in Cloudflare.

Step 1: Log in to Cloudflare to start. Find and click on your website on the list.

Step 2: Next, pick the DNS tab, then click the Proxy Status section on the Orange Cloud. You’re going to know that Cloudflare was off as the visible cloud became grey.

Fix 2: Pausing the Cloudflare.

After logging in, you can also choose to pause Cloudflare.

Step 1: From the list, select your connected site.

Step 2: Then, in the sidebar, scroll down until you see the Advanced Actions area. To stop Cloudflare from running on your site, click the Stop Cloudflare on the Site link.

Step 3: On the website, you’ll see a pop-up asking you to confirm that you wish to pause Cloudflare. Don’t hesitate to click the Confirm button.

Fix 3: Getting into the development mode.

You can keep Cloudflare running but put it in development mode if you don’t want to pause or disable it. This will allow you to troubleshoot error 520.

Step 1: Click the Caching tab towards the top of the screen after login into Cloudflare.

Step 2: After that, scroll down to the Development Mode area and flip the Off switch. “On” should now appear.

Fix 4: Checking the Error logs of the server.

You can troubleshoot error 520 by inspecting your server’s error logs now that you’ve deactivated, paused, or put Cloudflare into development mode.

If you’re unsure where to find your error logs, contact your web host provider. You can utilize the procedures below if your hosting provider uses cPanel.

Step 1: Go to the Metrics area of the dashboard after logging into cPanel. Then select Errors from the drop-down menu.

Step 2: The error log page shows errors in reverse chronological order, the most recent 300 messages. If you or your host changed the settings, the error log may show more errors.

Fix 5: Generating a HAR File.

An HTTP archive file is known as a HAR. It keeps track of requests that go to the origin server as well as requests that travel through Cloudflare.

Because it compares response headers from the origin server and Cloudflare when it’s used as a proxy, it can aid debugging. It’s also used to check if the headers are too large, which could be the cause of error 520. The methods below will show you how to produce a HAR file using your browser:

Step 1: Right-click on the page in your browser. Then choose Inspect.

Step 2: After the panel has opened, go to the Network tab and look for a red circle button on the upper left-hand side of the screen. Click it if it’s grey.

Step 3: Click the clear button after checking the Preserve log option next to the record button.Step 4: Reload the page that is causing the 520 problems. Then right-click anywhere in the Chrome developer tool’s messages section.Step 5: Save the file on your computer by selecting Save as HAR with Content.

Fix 6: The final step, if everything mentioned above has failed.

Contact Cloudflare support if you’re still having problems and wait for them to help you resolve the error. Give them the following information:

Step 1: When the error occurred, provide the full URL(s) to the support team.

Step 2: The Ray ID of Cloudflare from the website where the error 520 messages appeared.

Error 520 – Conclusion:

Because it’s a Cloudflare issue, the 520 error can be perplexing. However, it has to do with a server problem that prevents Cloudflare from connecting. The solutions to the most prevalent causes of error 520 are listed above.

If you’re still having problems after attempting these steps, you should contact your web hosting provider for further help.

Chris Wagner

I am Chris Wagner, Having 12+ years of experience in the Hosting industry.

Published by
Chris Wagner

Recent Posts

9 Best Student Hosting for 2025

Hello, Gen Z! Ready to fly high with your dreams? Let no one stop you…

6 months ago

5 Best HideMyAss Alternatives (#3 is Just Awesome)

Let's talk about HideMyAss Alternatives! But first, let us talk about HideMyAss. If you’re interested…

6 months ago

Kadence WP Review (2025)

These days the theme market is flooded and users are spoiled by choices. But if…

6 months ago

10 Best Tested Video Hosting Sites

Thinking of starting a video log or want to host your video on a video…

6 months ago

9 Best Ecommerce Hosting Providers in 2025

So, you‘re looking for the best ecommerce hosting company for your needs? No matter whether…

6 months ago

Turnkey Internet Review: My Honest Opinion + Pros & Cons

Why Trust Us "We have been a paying customer for Turnkey Internet since March 2019.…

6 months ago