Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
https://pctechmag.co.uk/ PC Tech Mag

Tech news, gadget reviews, tips, and digital trends — PC Tech Mag keeps you informed on everything technology.

https://pctechmag.co.uk/ PC Tech Mag

Tech news, gadget reviews, tips, and digital trends — PC Tech Mag keeps you informed on everything technology.

  • Home
  • About us
  • Contact us
  • Tech

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Find Us

Contact: farmanali5starseo@gmail.com

  • Home
  • About us
  • Contact us
  • Tech
Subscribe
Close

Search

An error message dialog with a warning symbol displayed on a computer screen
Tech

Error Code 520: What It Means and How to Fix It (2026)

By admin
November 20, 2026 9 Min Read
1

Error code 520 means a website’s server returned an empty, unknown, or unexpected response. In plain terms, the browser reached the site, but the site’s origin server did not send back a usable web page. The error is best known as a Cloudflare error, and it usually appears with the message “Web server is returning an unknown error” or “Error 520: Web server is returning an unknown error.”

If you see error code 520 as a visitor, the problem is almost never with your computer. It is usually a problem on the website’s server, a crashed application, a firewall blocking the connection, or a misconfiguration between the website and Cloudflare. The good news is that the error is often temporary, and there are clear fixes for both visitors and website owners.

This guide explains what error code 520 means, what causes it, how it differs from similar Cloudflare errors, and exactly how to fix it, step by step.

What Is Error Code 520?

Error code 520 is a Cloudflare-specific error. Cloudflare sits between visitors and a website’s origin server. When you visit a Cloudflare-protected site, your request goes first to Cloudflare, which then forwards it to the origin server and returns the server’s response to you.

Error 520 happens when Cloudflare successfully connects to the origin server, but the origin server returns a response that Cloudflare cannot understand, or returns nothing at all. Cloudflare therefore shows the 520 error page instead of the website.

That is different from a connection failure. If Cloudflare could not reach the server at all, you would usually see a different error, such as error 521 or 522. With error 520, the connection was made, but the answer was empty or invalid.

What Causes Error Code 520?

Several server-side problems can trigger error 520. The most common causes are listed below.

1. The origin server crashed or restarted

If the web server process, such as Apache, Nginx, or the application behind the site, crashes, restarts, or runs out of memory, it may drop the connection or send an empty response. Heavy traffic, a bad plugin, or a faulty update can all cause this.

2. The server sent an invalid or empty response

A server can return a response with missing headers, a malformed HTTP response, or no content at all. Cloudflare treats this as an unknown error and displays error 520. Large response headers, often caused by too many cookies, are a known trigger.

3. A firewall or security tool is blocking Cloudflare

Some firewalls, security plugins, and rate-limiting tools block Cloudflare’s IP addresses by mistake. The server may then close the connection or return an error page that Cloudflare cannot pass on to the visitor.

4. DNS or Cloudflare configuration problems

If the site’s DNS settings point Cloudflare to the wrong server, or if the origin server’s IP address has changed and Cloudflare was not updated, the request can reach the wrong machine, which returns an unexpected response.

5. SSL and HTTPS problems

An expired SSL certificate, a certificate for the wrong domain, or a mismatch between the SSL mode in Cloudflare and the SSL setup on the origin server can also cause error 520, especially when the site forces HTTPS.

6. PHP or application errors

On WordPress and other content management systems, a broken plugin, a faulty theme, or a PHP fatal error can stop a page from loading. The server may then return an empty response instead of a normal page.

Error 520 vs Other Cloudflare Errors

Cloudflare’s 5xx errors look similar, but they mean different things. Knowing the difference helps you find the right fix.

Error code Meaning Usual cause
520 Web server is returning an unknown error Empty or invalid response from the origin server
521 Web server is down Origin server refused the connection
522 Connection timed out Origin server took too long to respond
523 Origin is unreachable Cloudflare cannot route to the origin server
524 A timeout occurred Origin server took over 100 seconds to respond
525 SSL handshake failed SSL negotiation between Cloudflare and the origin failed

If you see error 520, focus on the origin server itself. If you see a different code, the fix may be different. For a related Cloudflare error, see our guide to Error 1015, which is a rate-limit error rather than a server error.

How to Fix Error Code 520 as a Visitor

As a visitor, you cannot fix the website’s server, but you can rule out problems on your side and try a few quick checks.

Step 1: Refresh the page

Press F5, or Ctrl + R on Windows and Cmd + R on a Mac. Error 520 is often caused by a brief server restart or a momentary overload, so a refresh a minute later may load the page normally.

Step 2: Try again in a few minutes

If a refresh does not work, wait five to ten minutes and try again. Many 520 errors clear on their own when the server recovers or the site owner restarts the web service.

Step 3: Clear your browser cache and cookies

A large or corrupt cookie can make the server return an oversized response header, which Cloudflare rejects. Clear the cache and cookies for that site, close the browser, and try again.

Step 4: Try a different browser or device

Open the same link in another browser, in a private or incognito window, or on your phone. If the site loads elsewhere, the problem is likely with your browser’s cached data or an extension.

Step 5: Disable browser extensions and VPNs temporarily

Ad blockers, security extensions, and some VPNs can interfere with a site’s connection. Turn them off one at a time and reload the page to see whether the error disappears.

Step 6: Check whether the site is down for everyone

Use a down-detector website or ask someone else to try the link. If the site is down for everyone, the problem is on the server side, and only the site owner can fix it.

Step 7: Contact the website owner

If the error lasts for hours, contact the site through its social media accounts or support email. Tell them the exact page, the time you saw the error, and that it was error code 520. That information helps them find the cause quickly.

How to Fix Error Code 520 as a Website Owner

If error 520 appears on your own site, work through these fixes in order. Most cases are solved in the first three steps.

Step 1: Check that your origin server is running

Log in to your hosting account or server and check the web server and database services. Restart Apache, Nginx, or PHP-FPM if they have stopped, and check the server logs for crashes or out-of-memory errors. A server that has run out of disk space or memory will often return empty responses.

Step 2: Check the server error logs

Look at the web server and PHP error logs around the time the error appeared. Fatal PHP errors, database connection failures, and timeouts are common culprits. Fix the error the log points to, such as a broken plugin or a database that needs repair.

Step 3: Disable recently changed plugins or code

If the error started after an update, disable the most recently updated plugin, theme, or code change and test the site. On WordPress, you can rename the plugin folder from your hosting file manager to disable all plugins at once, then re-enable them one by one.

Step 4: Check your firewall and security settings

Make sure your firewall, hosting provider, and security plugins allow Cloudflare’s IP address ranges. If your server uses a tool such as Fail2Ban or ModSecurity, check whether it is blocking Cloudflare. Also check that your server is not rate-limiting Cloudflare’s requests.

Step 5: Check DNS and Cloudflare settings

In your Cloudflare dashboard, confirm that the DNS records point to the correct origin IP address. If you recently changed hosts, update the A record. Also check that your SSL mode in Cloudflare matches your server: if your server has a valid certificate, use Full or Full (Strict); if it does not, do not force a mode your server cannot support.

Step 6: Reduce oversized response headers

Cloudflare rejects responses with very large headers. This can happen when a site sets too many cookies. Clear unnecessary cookies, reduce the number of cookies your site sets, and keep response headers as small as possible.

Step 7: Test with Cloudflare paused

In the Cloudflare dashboard, use Development Mode or pause Cloudflare temporarily and visit your site directly. If the site loads with Cloudflare paused, the problem is in the interaction between Cloudflare and your server. If it still fails, the problem is on your server alone.

Step 8: Contact your hosting provider

If you cannot find the cause, send your host the error details and the time it happened. Ask them to check the server logs, the firewall, and whether the origin server dropped the connection. A good host can usually identify a 520 cause from the logs in minutes.

Common Problems and Fixes

Error 520 appears only on some pages. The problem is probably with a specific page, plugin, or database query. Check the logs for that page and disable the plugin that powers it.

Error 520 appears after a server move. Update the DNS records in Cloudflare to the new server’s IP address, and allow time for the change to spread.

Error 520 appears at busy times. Your server may be running out of resources under load. Upgrade your hosting plan, enable caching, or optimise slow database queries.

Error 520 appears with a blank page. This points to a PHP fatal error or a crashed application. Check the PHP error log first.

Error 520 keeps coming back. A recurring 520 usually means an unfixed server problem, such as a memory leak, a misconfigured firewall, or a plugin that crashes the server. Fix the underlying cause rather than restarting the server each time.

For general network checks while you troubleshoot, our guide to Netstat explains how to see which connections and ports your computer is using, which can help you confirm that your own connection is working normally.

How to Prevent Error Code 520

You cannot prevent every server error, but you can make error 520 much less likely. Keep your server software and plugins updated, monitor your server’s memory and disk space, and set up alerts so you know when a service stops. Use caching to reduce the load on your origin server, and test changes on a staging site before applying them to your live site. If you use Cloudflare, keep your DNS records up to date and make sure your firewall allows Cloudflare’s IP ranges.

Frequently Asked Questions

What does error code 520 mean?

Error code 520 means the web server returned an empty, unknown, or unexpected response. It is a Cloudflare error that appears when Cloudflare connects to the origin server but cannot use the response it receives.

Is error 520 my fault as a visitor?

Usually not. Error 520 is almost always a server-side problem. Visitors can try refreshing the page, clearing cookies, or waiting a few minutes, but the permanent fix must be made by the website owner or hosting provider.

How long does error 520 last?

It depends on the cause. A brief server restart may cause error 520 for a few seconds or minutes. A firewall misconfiguration or a broken plugin can cause it for hours or days until someone fixes the server.

What is the difference between error 520 and error 521?

Error 520 means the server returned an unknown or empty response. Error 521 means the server is down and refused the connection. Error 520 is a bad response; error 521 is no response at all.

Can a VPN cause error 520?

A VPN does not usually cause error 520, because the error comes from the website’s server. However, if a VPN or browser extension interferes with the connection, try disabling it and reloading the page to rule it out.

Conclusion

Error code 520 is a Cloudflare error that tells you the website’s server returned an empty or unknown response. For visitors, the best steps are to refresh the page, wait a few minutes, clear cookies, and try another browser. For website owners, the fix is usually found in the server logs, a crashed service, a firewall blocking Cloudflare, or a DNS or SSL misconfiguration. Fix the server-side cause, keep your software updated, and monitor your server, and error 520 should stay away.

Author

admin

Follow Me
Other Articles
An error message dialog with a warning symbol displayed on a computer screen
Previous

Error 1015: What Is Error 1015 and How to Fix It?

A modern CD player hi-fi component on a wooden shelf beside a stack of music CDs
Next

Best CD Players in 2026: Top Picks for Every Budget

One Comment
  1. Error Code 525: What It Means and How to Fix It - PC Tech Mag says:
    November 24, 2026 at 4:32 am

    […] the connection timed out. Each code helps narrow down the problem. For comparison, see our guide to Error 520: What Does Error 520 Mean and How to Fix It? and our guide to Web Server Is Down Error Code 521. If you see a 525, the secure connection itself […]

    Reply

Leave a Reply Cancel reply

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

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Search

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Find Us

Contact: farmanali5starseo@gmail.com

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Archives

  • December 2026 (15)
  • November 2026 (192)
  • October 2026 (85)

Find Us

Contact: farmanali5starseo@gmail.com

Copyright 2026 — PC Tech Mag. All rights reserved. Blogsy WordPress Theme