Cloudflare error 520 is an unexpected response or empty message returned from the origin server. The main reason for this error message is that the server appears to be busy or unable to respond in time.
So how did you fix this error? In this article, you will find the answers to fix Cloudflare error 520.
What is Cloudflare error 520?
Table of Contents
Cloudflare Error 520 is a diagnostic message received from the server indicating that the response sent to the server is delivered as an invalid HTTP response or the request is not interpreted or the server is unable to process the request.
The main reason for this error message from the server is that the server may already be busy or overloaded, or that the server is running out of resources.
How can you fix this problem?
To solve this problem, you have many options. Here I will recommend you some solutions that will give you the right solution.
- Disable Cloudflare
- Restart server
- Remove plugins
- Configure DNS in Cloudflare properly
We can jump into the troubleshooting process first.
Error 520 can occur due to many reasons, and to fix it, you need to troubleshoot. Now, let us move on to troubleshooting to identify the error. Before that, you should know that all errors are stored in a log.
Step 1: Before start troubleshooting, just disable Cloudflare. To do this, simply follow the steps below.
First, select your website and click on the link. Then, click on the “DNS” icon. Select the link you want to disable and click on the cloud icon under “Proxy Status”. Disable Cloudflare and the disabled cloud icon will be displayed in gray color.
Click on the overview option on the top and scroll down and select disable link to disable the Cloudflare.
Next, give your confirmation for pausing the Cloudflare.
Step 2: Check your server error logs in cPanel.
Now you have paused or disabled your Cloudflare and now we can see the server logs using the cPanel. The below is for cPanel users to check the errors in the server log.
Log in to the cPanel and click on the “Errors” link under the Metrics.
Now you can see the error logs in reverse order where the last 300 errors will be shown.
Usually, the cause of 520 error is the failure of a web server. Web server failure is caused by excessive resource utilization. In most cases, the server is busy working on the allocated resources. Therefore, the requests received by the server are not processed.
To fix Cloudflare 520 error, you just need to restart the webserver once to fix the problem.
Sometimes overuse of plugins can cause 520 errors because plugins generate a large header size that Cloudflare may not be able to handle. Some plugins can store large data in cookies.
To avoid 520 errors, simply remove the unwanted plugins you are using for your website. This can reduce the frequent occurrence of 520 errors.
Configure DNS properly in Cloudflare
You may get a blank response from the webserver if the DNS in your Cloudflare is not configured properly. Therefore, you should check the DNS configuration in the domain. You need to make sure that the record is pointing to the correct IP address.
Wait, you still have some more techniques to resolve the 520 Error.
More techniques to resolve error 520
- The connections in the webserver or other network devices are reset or updated when a TCP handshake occurs. In this case, the webserver does not know how to handle or process these requests. It is cleared when the user refreshes their page. If you get the same error, reconfigure your device.
- In some cases, the PHP application on the webserver may occupy a lot of memory, so the server sends the unknown error to the user. So, you should always practice restarting the device during routine maintenance. This will avoid overload and crash problems.
- In some cases, the unknown error message is displayed if the IP address of your device is not in the list of allowed addresses. Therefore, periodically check if your IP address is included in the list of allowed addresses.
- Perhaps the request generated by the user agent has an older browser version. This may be the reason for the 520 error. So update your browser to the latest version and the error is fixed.
- More cookies loaded can cause the 520 error. Using multiple plugins on your website can increase the size of the HTTP response header. Therefore, remove the unwanted plugins that may decrease the cookie size. The size of the cookies should be 8K or less.
I hope you are satisfied with this article. You are getting error 520 because the origin server is returning an empty message to you. To resolve this issue, the above steps will help you. If you try these steps, you will surely get the expected solution.
Hope you like our post, How to Fix Cloudflare error 520. You can follow us on Facebook and Twitter to get the latest updates.
Prabhu Ganesan provides his web development and WordPress services independently. He is the founder of WPBlogX. He is very much involved in WordPress as it becomes second nature for him. You can get in touch with him by visiting his website – WPBlogX.com and you can also find him on Twitter @gprabhucbe.