25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Tips to fix Cloudflare 520 error

by | Jun 29, 2020

Cloudflare 520 error is a common error that triggers when the origin server returns an empty or unexpected response. This happens mainly when the server is unable to send a timely response due to a resource-intensive process.

As a part of our Server Management Services, we have helped online service providers to fix several similar Cloudflare errors.

Today, let’s discuss some tips to fix the error “Web server is returning an unknown error”.

What causes Cloudflare 520 error?

 

Cloudflare error 520 triggers when the origin server returns an empty, unknown, or unexpected response to Cloudflare. When a program, cron job, or resource is taking up more resources than it should, the server may not be able to respond to all requests properly. As a result, it triggers “Error 520: Web server is returning an unknown error”.

Cloudflare 520 error

The possible reasons for this error include:

  • Origin web server application crashes: One of the major reasons for this error is the webserver application crash at the origin server. Execution of a resource-intensive script is the most probable reason that leads webserver application crash. As a result, the server will not be able to respond to the requests in a timely manner.
  • Cloudflare IPs not allowed at the origin: Origin server’s firewall can cause a hindrance while connecting through the IP address that is not whitelisted. Hence, if Cloudflare’s IP address is not whitelisted, it can, in turn, lead to the 529 error. Whitelisting it can fix the issue.
  • The origin web server TCP idle timeouts shorter than 300 seconds: TCP protocol establishes and maintains a network connection. If its timeout value is too low, it can trigger the unknown error.
  • Headers that exceed Cloudflare’s header size limit (8kb): Excessive use of cookies or the use of cookies that are large will increase the size of the headers. As Cloudflare has a limit of 8kb for the header size limit, it won’t be able to process the header.
  • Empty response from the origin web server that lacks an HTTP status code or response body: This generally happens when the DNS of the domain is pointing to a wrong server.

 

How to fix the Cloudflare 520 error?

Lets now look at some tips to fix this error.

Disable Cloudflare:

The first step in fixing the 520 error is to isolate the Cloudflare factor from it. There are several methods to perform this. We could either disable it from the Cloudflare Home page. We could also try turning off the Cloudflare DNS cloud to grey or pause the Cloudflare option.

Once it is turned off we could then search for the error logs to find further details of the error for the crash.

Restart the webserver

The major reason for the 520 error is the failure of the web server application. It primarily happens due to excessive resource usage in the server. We already have several blogs that discuss handling excessive resource usages.

Remove plugins

Larger header sizes can be related to excessive use of plugins that requires too many cookies. Some of them also store too much data in cookies. This makes the headers heavy and Cloudflare may not be able to handle them.

The fix here would be to try disabling those plugins one by one. If there are quite a lot of plugins that need cookies, it is also a preferred to remove some of them.

Ensure DNS is set properly in Cloudflare

An empty response from the origin web server generally happens due to an improper configuration of DNS entry at Cloudflare end. Thus it is not a bad idea to cross-check the existing DNS records added to the domain. Ensure that the A record points to the correct IP address.

[Need assistance to fix Cloudflare errors? We’ll help you.]

 

Conclusion

In short, the 520 error in Cloudflare happens when the origin server returns an empty, unknown, or unexpected response to Cloudflare. Today we discussed some tips that our Support Engineers follow to fix the Web server is returning an unknown error message.

 

 

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF