Web server is returning an unknown error
A common Cloudflare 520 error triggered when the origin server returns an empty or unexpected response. The server-side diagnostic message indicates that even though a request reached the origin web server, the server received an invalid HTTP response or didn’t know how to interpret the request at all and was unable to proceed.
Following are common reason for this error including:-
-
Origin web server application crashes.
-
The origin server does not allow connection from Cloudflare IP.
-
The origin web server TCP idle timeouts.
-
Cloudflare-incompatible response headers.
-
Empty response from the origin web server.
Now, let’s take a look at some tips to fix Cloudflare 520 error:-
-
Ensure Cloudflare DNS records pointing correctly.
-
Check the response header.
-
There could be various reasons for the missing response header. Check your origin response headers in your Cloudflare server’s HAR (HTTP Archive) files - How do I generate a HAR file?
-
If you see a response for an outdated web browser, thus it's a signal that the connection is coming from an old version of Internet Explorer or Safari.Make sure your site is compatible with common web browsers, although fringe user agent connections will sometimes appear no matter what.
-
If you find that the excessive use of cookies or cookies that are too large are causing the error 520, consider using a cookie-free domain.
-
Investigate error log.
-
Use a cURL command.
curl -svo /dev/null http://www.example.com/
-
Disable Cloudflare.
-
You may isolate the Cloudflare factor from it. Disable Cloudflare by logging to Cloudflare Dashboard and clicking on the DNS tab. Choose a domain, then toggle the Proxy status button. Alternatively you can temporarily pause the Cloudflare will block traffic from going through Cloudflare’s network, revealing the IP address of your origin server. Then search for the error logs to find further details of the error for the crash.
-
Restart web server.
-
Whitelist Cloudflare origin server IP Address.
- As a part of Cloudflare’s built-in security protocols, you have to whitelist your origin web server IP addresses in your Cloudflare dashboard. Sometimes Cloudflare returns a more descriptive error code when an IP address is explicitly blocked.
In short, the 520 error in Cloudflare happens when the origin server returns an empty, unknown, or unexpected response to Cloudflare. The 520 error not only affect user experience but also prevent you from logging in to your site’s dashboard. Therefore, you need to find out ways to fix it right away.
|