Black Friday Special Offers
520 errors are CDN-specific, not web server-specific, and are a catch-all error. With Cloudflare, the most common service where we see 520 errors, this means that the web server returned an unknown error. This “I’ve no idea what’s going on” error makes it a bit of a nightmare to troubleshoot.
The bulk of this article will primarily focus on Cloudflare, but the same troubleshooting steps will likely hold true for most CDNs who are also adopting the same error codes.
That said, you may still want to Google “520 Provider Name” (for example, “520 QUIC.cloud”) though, as that may provide some more relevant troubleshooting steps.
Cloudflare has its own documentation for troubleshooting 5XX errors. This can be viewed here:
In the above article, they state that this can be caused by:
- Origin web server application crashes
- Cloudflare IPs are not allowed at your origin
- Headers exceeding 16 KB (typically due to too many cookies)
- An empty response from the origin web server that lacks an HTTP status code or response body
- Missing response headers or origin web server not returning proper HTTP error responses
What We’ve Seen
Typically 520 errors are pretty rare when using Cloudflare with GridPane, and the second option can be ruled out unless you yourself have reconfigured that.
An empty response or excessively large headers are the most likely culprits. Cloudflare may also have closed the connection early.
Usually, the best option when you encounter a 520 error is to disable Cloudflare’s proxy or your CDN, but in the unlikely event that there’s an issue with
Step 1. Check Your DNS Records are Correct
It’s possible that you may be having DNS issues. Check that your DNS records are pointing to the right place.
Step 2. Check the Cloudflare (or your CDN) Status Page
Maybe Cloudflare or your CDN is having an active incident that’s causing issues in pockets around the world. Check Cloudflare’s status page for issues here:
If issues are reported, deactivate the proxy.
If you absolutely do not want to disable Cloudflare, you can create a HAR file. See the section below.
Step 3. Check Monit
- Are all your services up and running? (PHP, Nginx/OpenLiteSpeed, MySQL). If no, this is likely the problem – click on the service name and attempt to start/restart the service.
- Is there high CPU and/or very high RAM usage? If yes, this is likely the problem. Our documentation on troubleshooting 502 errors and 504 errors are likely what you need to follow after first deactivating Cloudflare.
To open Monit, head to your Servers page inside your GridPane account and click the green pie chart icon next to your server:
Step 4. Deactivate Cloudflare
Ruling out Cloudflare of the cause is usually the best option. From there, if there are no further issues, you know it’s Cloudflare (or other CDN) and not your server.
If issues continue to happen, then you will get the correct server error and can troubleshoot accordingly.
Once you’ve identified and resolved the underlying issue you can turn it back on.
Step 5. Check Your Logs
With Cloudflare out of the way, any server errors will now provide insight on how to proceed.
The website error logs may also provide some legitimate website errors that could potentially be causing issues.
Check your website’s Nginx or OpenLiteSpeed error log. You can find this inside your GridPane account by heading to your Sites page and clicking on the name of the site to open up the customizer. Click through to the logs tab and you will find the error log at the bottom:
When checking the log, look for the errors that correspond to your website checks.
You can also activate WP Debug by clicking the toggle at the top of this tab, and this will install the query monitor plugin and potentially log more specific errors. More details on this can be found here:
Create a HAR File
A HAR is an HTTP archive file, and if you’re contacting Cloudflare support you will need to provide them with one (and it’s also a good idea to do the same for other CDN providers as well).
A HAR file will record all requests made by the browser, including the request & response headers (so you can confirm if your site’s headers are too large for Cloudflare). HAR files are also useful when troubleshooting issues that are difficult to replicate.
1. Create a HAR file in Chrome
1. Head over to the URL where you’re experiencing 520 errors, right-click and choose Inspect:
2. Next, click through to the Network tab. The circle in the top-left should already be red, but if it’s grey, click it. Also check the “Preserve Log” checkbox.
3. Now refresh the page. Here we want to record the page load with the error occurring.
4. Once you’ve captured that, right-click on any of the filenames in the bottom left, and choose “Save all as HAR with content“.
You’ve created your HAR file.
2. Create a HAR file in Microsoft Edge
The process for Edge is the same as Google Chrome. The screenshots in the above section are from Chrome, but you can follow them step for step in Edge too.
3. Create a HAR file in Firefox
The process is almost the same as Chrome:
- Head over the URL, right-click and choose Inspect.
- Click through to the Network tab and then reload the page
- Once the page has fully reloaded right-click anywhere inside the tab and choose “Save All As HAR“.
4. Create a HAR file in Safari
- Head over the URL, right-click and choose Inspect.
- Click through to the Network tab, check the “Preserve Log” checkbox (this is located on the right-hand side), and then reload the page.
- Once the page has fully reloaded there’s also a button on the right labeled “Export“. Click this to save your HAR file.
If 520 Errors Continue
If you’ve followed the above steps and you still see issues when you turn Cloudflare or your CDN back on, contact their support.
When reaching out to Cloudflare support they will ask for the following:
- The full URLs where the error/s occurred
- The Cloudflare Ray ID/s from when you saw the 520 error
- The HAR file from when Cloudflare was enabled
- The HAR file from when Cloudflare was disabled