How to Fix Error Code 520 (2024)

The 520 error pops up when Cloudflare, acting as a bridge between you (the visitor) and the website’s server, gets a response from the server that it just can’t interpret. Imagine you’re having a conversation where suddenly the other person starts speaking in an unknown language. You know they’re trying to communicate, but you can’t decipher the message. That’s Cloudflare with Error 520—it received something, but it can’t make heads or tails of it.

This issue could stem from a variety of sources: configuration mishaps on the server, network connectivity issues, overly aggressive firewall rules, or even faulty server hardware. Understanding Error 520 requires a grasp of how Cloudflare interacts with web servers and the myriad ways that this interaction can go awry.

How to Fix Error Code 520 (1)

Say goodbye to website errors

Achieve peace of mind with 99.99% uptime on 10Web Managed
WordPress Hosting, powered by Google Cloud.

Learn How

Reasons why this error occurs

Server overload: The most straightforward reason. If the server is buckling under heavy traffic, it might fail to respond correctly to Cloudflare’s requests.

Configuration errors: Incorrect settings on the server can confuse Cloudflare. It’s akin to sending mixed signals—Cloudflare reaches out in the expected manner, but the server responds in an unexpected way.

Network issues: Sometimes, the path between Cloudflare and the server has bumps. Network interruptions or delays can corrupt or halt the response before it fully reaches Cloudflare.

Security software: Overzealous security settings or software on the server might see Cloudflare’s legitimate request as a threat and block or alter the response.

Faulty server hardware or software: Rare, but not unheard of. Faulty hardware or a bug in server software can lead to unpredictable responses.

Resolving common reasons for Error 520

Several common issues can trigger Error 520, including PHP crashes, blocked Cloudflare IPs, TCP idle timeouts, and oversized headers. Addressing these specific areas can help eliminate the error by ensuring your server is optimally configured to work with Cloudflare.

Restart PHP/Apache/Nginx

Web services like PHP, Apache, and Nginx form the backbone of your server’s ability to handle requests. Anomalies within these services can lead to various errors, including Error 520. Restarting these services can reset their state, potentially resolving any temporary glitches or errors that might be causing issues with Cloudflare.

For PHP-FPM (FastCGI Process Manager)

  1. Use a terminal or SSH to connect to your server.
  2. Use the following command to restart the PHP server:
sudo service php7.4-fpm restart

The command may vary based on the PHP version. A common command is sudo service php7.4-fpm restart, replacing 7.4 with your PHP version.

Apache

  1. Access Your Server via SSH.
  2. Use the following command for Apache:
sudo systemctl restart apache2 

On older systems, the command might be sudo service apache2 restart.

Nginx

  1. Access your server via SSH.
  2. Use the following code to restart Nginx:
 sudo systemctl restart nginx

For older systems, you might use sudo service nginx restart.

For websites hosted on 10Web, you can restart your PHP from the 10Web dashboard.

How to Fix Error Code 520 (2)

Whitelist Cloudflare IPs

Cloudflare’s IPs are used to proxy traffic to your server, enhancing security and performance. If your server’s firewall or security settings block these IPs, Cloudflare cannot communicate with your server, leading to Error 520. Whitelisting Cloudflare’s IPs ensure uninterrupted traffic flow.

To whitelist Cloudflare’s IPs:

How to Fix Error Code 520 (3)

    1. Visit Cloudflare’s official documentation to find the latest list of IP ranges.
    2. Access your server’s firewall settings
    3. This might involve SSH access and using iptables or a firewall management interface.
    4. Use commands or interfaces to whitelist the IP ranges.
    5. For iptables, the command would look like:
sudo iptables -I INPUT -p tcp -s <Cloudflare_IP> --dport 80 -j ACCEPT,
  1. Replace <Cloudflare_IP> with each IP range from Cloudflare.

Adjust TCP idle timeouts

TCP idle timeouts can disconnect seemingly inactive connections, potentially disrupting Cloudflare’s ability to communicate with your server. Increasing these timeouts ensures that connections remain open for a sufficient duration, reducing the likelihood of premature disconnections. Adjust the timeout parameters so that they are at 300 seconds. Anything under 300 may be causing the error.

Reduce header size

Large request headers, especially when laden with cookies or extensive security tokens, can exceed Cloudflare’s limits, triggering Error 520. Reducing the size of these headers ensures compatibility with Cloudflare’s requirements.

  • Tools like Chrome’s Developer Tools can help you see the size and content of your request headers.
  • Review your server or application configuration to find where excessive headers are added. Look for excessive cookies, redundant custom headers, or overly large tokens.
  • Implement changes in your server or application settings to minimize header output.
  • For Apache, use LimitRequestFieldSize directive in httpd.conf to set maximum header size.
  • For Nginx, adjust large_client_header_buffers in nginx.conf.

Empty response header

An empty response header or an empty response from your server indicates that a request was made to the server, but there was no information returned. This can manifest as a lack of HTTP status code or response body, leading browsers to show an error or a blank page. This problem often stems from incorrect DNS settings for your site’s domain.

Resolving this issue involves verifying and correcting your DNS configurations, ensuring they accurately point to your server. Since DNS settings are crucial for directing internet traffic to your server, any misconfiguration can lead to your site being inaccessible.

If you have recently changed your DNS settings, make sure you give ample time for propagation. Once your settings have been checked and adjusted, you should clear your website cache.

If your website is hosted on 10Web, you can clear your website cache using 10Web Cache either from your 10Web dashboard or from the admin dashboard of WordPress.

How to Fix Error Code 520 (4)

How to troubleshoot Error 520: A Comprehensive Guide

Temporarily disable Cloudflare

Disabling Cloudflare temporarily is a diagnostic step to determine if the error originates from Cloudflare’s configuration or from the server itself. By bypassing Cloudflare’s network, you can directly assess whether your server is the source of the problem. This step involves either disabling the proxy (the orange cloud icon in DNS settings) for individual records or pausing Cloudflare’s services entirely for your site.

Disabling Cloudflare’s proxy

How to Fix Error Code 520 (5)

  1. Log into your Cloudflare account
  2. Navigate to the dashboard and select the site experiencing issues.
  3. Click on the DNS tab.
  4. Look for DNS records with an orange cloud icon, signifying they are proxied through Cloudflare.
  5. Click on the orange cloud icons to turn them gray.

This action disables Cloudflare’s proxy.

Pausing Cloudflare entirely

How to Fix Error Code 520 (6)

  1. On your site’s dashboard, locate the Overview tab.
  2. Find the Advanced Actions section and select Pause Cloudflare on Site.
  3. Confirm your choice.

This halts all Cloudflare’s operations, allowing traffic to reach your server directly.

Activate development mode

Activating Cloudflare’s Development Mode is useful for troubleshooting issues without fully disabling Cloudflare’s services. Development Mode temporarily suspends Cloudflare’s edge caching, allowing you to see changes in real-time. This is particularly helpful for identifying whether caching or Cloudflare-specific optimizations are contributing to the error.

To activate development mode:

How to Fix Error Code 520 (7)

  1. Log into Cloudflare and select your affected site.
  2. Find the Caching Tab at the top of your Cloudflare dashboard.
  3. Scroll to the Development Mode section and toggle the switch to On.

This mode remains active for 3 hours, after which it automatically reverts.

Checking your server’s error logs

Server error logs are invaluable for diagnosing issues, providing insights into what’s happening on your server. These logs can reveal specific server-side errors that might cause Error 520. Accessing and interpreting these logs can help identify problematic patterns, such as script errors or configuration issues.

To check your error logs:

  1. Log into your web hosting account.
  2. Locate error logs.
  3. This can vary; for example, in cPanel, look under the Metrics section for Errors.
  4. Search for timestamps correlating with the occurrence of Error 520. Pay attention to any recurring errors or critical messages that could indicate server issues.

If your website is hosted at 10Web, you can access your logs from the 10Web dashboard under Hosting Services. Here is a guide on how to access the server logs of your site.

How to Fix Error Code 520 (8)

Using cURL to test directly

cURL is a versatile command-line tool used for transferring data with URLs. Its wide range of protocols makes it a powerful tool for testing web connectivity and server response. In the context of troubleshooting Error 520, cURL becomes particularly useful. It allows you to bypass Cloudflare’s network and directly test the accessibility and response of your origin server as if you were accessing it from a web browser. This direct approach is crucial for isolating whether Cloudflare or the origin server is the source of the issue. By simulating a browser request using cURL, you can observe the server’s raw response, including HTTP status codes, headers, and body content. This information can provide valuable insights into server behavior, configuration issues, or errors that might not be evident when traffic passes through Cloudflare’s proxy.

Detailed steps for using cURL to test server response

Before using cURL, ensure you have access to a command line interface (CLI), such as Terminal on macOS and Linux or Command Prompt on Windows. If cURL is not already installed on your system, you may need to download and install it from the official cURL website or use a package manager on Linux or macOS.

Let’s get started:

    1. On Windows, search for Command Prompt and open it.
    2. On macOS or Linux, open the Terminal application.

The basic syntax for a cURL command to test your website is as follows:

```bashcurl -Iv https://yourwebsite.com```
    1. Replace https://yourwebsite.com with your actual domain name.

The -I option tells cURL to fetch the HTTP headers only, which is often sufficient for diagnosing connectivity issues. The -v option enables verbose output, providing detailed information about the request and response process.

  1. Type the constructed command into your CLI and press Enter.

Long information will be displayed, showing the entire connection process, including DNS resolution, the request sent, and the server’s response.

Analyze the output

    1. Look for the HTTP status code in the response.

A 200 series status code indicates success, while a 5xx error suggests server-side problems.

  1. Examine the headers for clues about server configuration, such as Server, Content-Type, and any specific security headers or cookies.

The long output may include errors or warnings about SSL certificates, redirection loops, or unreachable URLs, which can provide insights into issues affecting accessibility.

Testing direct server IP (Optional)

If you want to bypass DNS resolution and test the server directly using its IP address, you can modify the cURL command as follows:

```bashcurl -Iv --resolve yourwebsite.com:443:123.123.123.123 https://yourwebsite.com```
  1. Replace 123.123.123.123 with your server’s IP address
  2. Adjust the port number (e.g., 443 for HTTPS or 80 for HTTP) accordingly.

The –resolve option tells cURL to use the specified IP address for the given domain, effectively bypassing DNS.

Simulating specific user agents (Optional)

To mimic requests from different browsers or devices, you can add a User-Agent header to your cURL command:

```bashcurl -Iv -H "User-Agent: Mozilla/5.0" https://yourwebsite.com```

This can be useful for identifying issues that only appear under specific conditions, such as mobile browsers or search engine crawlers.

Creating a HAR file for deeper analysis

HTTP Archive (HAR) files are a structured format for recording the interactions between a web browser and a website’s servers. These files capture detailed information about each web request and response, including the headers, body content, status codes, and timings. HAR files are invaluable for diagnosing complex web issues because they provide a comprehensive snapshot of the browser’s activity during the occurrence of an error or issue. When dealing with Error 520 or similar problems, creating a HAR file while the error is being reproduced allows you to capture a detailed log of the network activity. This data can then be analyzed to pinpoint specific requests or responses that may be contributing to the issue. Additionally, HAR files are often requested by technical support teams as they offer a clear, chronological view of the web transactions, enabling a more accurate and swift diagnosis.

Google Chrome

How to Fix Error Code 520 (9)

  1. Right-click and select Inspect. This opens the Developer Tools.
  2. Go to the Network Tab and ensure it’s recording (red circle icon).
  3. Navigate to the page where Error 520 occurs to reproduce the error.
  4. Right-click within the Network tab, choose Save all as HAR with content, and save the file.

Firefox

How to Fix Error Code 520 (10)

  1. Navigate to the webpage where the issue occurs.
  2. Right-click on the page and select Inspect Element from the context menu.
  3. Click on the Network tab to view all network requests and responses. If it’s not visible, you might have to click on the >> icon to find it.
  4. Ensure the recording is started by confirming that the red record button at the top left corner of the Network tab is activated. If it’s not, click it to start recording.
  5. Refresh the page or perform the actions that lead to the problem you’re diagnosing in order to reproduce the issue.
  6. Right-click anywhere within the list of network requests and select Save All As HAR from the context menu.

Safari

How to Fix Error Code 520 (11)

  1. Click on Safari in the menu bar and select Preferences.
  2. Go to the Advanced tab.
  3. Check the box at the bottom that says Show Develop menu in menu bar.
  4. Navigate to the webpage where the issue is occurring.
  5. Click on the Develop menu in the Safari menu bar and select Show Web Inspector. Alternatively, you can right-click on the webpage and select Inspect Element.
  6. Click on the Network tab within the Web Inspector to monitor network requests and responses.
  7. With the Network tab open, reload the webpage or perform the actions that trigger the issue. Ensure you do this step immediately after starting the recording to capture all necessary data.
  8. Once you’ve replicated the issue and captured the network activity, click on the Export button (represented by an arrow pointing out of a box) located at the bottom of the Network tab.
  9. Save the HAR file to your desired location on your computer.

Re-Enabling Cloudflare

After troubleshooting, it’s important to revert any temporary changes made during the diagnostic process.

  • If Cloudflare was paused or disabled, return to your Cloudflare dashboard and reactivate the services.
  • If in development mode, ensure to turn it off so Cloudflare’s caching and optimizations are re-enabled.

Conclusion

Troubleshooting Error 520 requires an efficient approach, starting from isolating the issue to identifying server-side errors and making necessary adjustments. By following these detailed steps, you can effectively diagnose and resolve the underlying causes of Error 520, ensuring your site remains accessible and performs optimally with Cloudflare.

How to Fix Error Code 520 (12)

Say goodbye to website errors

Achieve peace of mind with 99.99% uptime on 10Web Managed
WordPress Hosting, powered by Google Cloud.

Learn How

Say goodbye to website errors

Fix all the website errors in one click

Migrate your website to the world's best Managed WordPress Hosting.

Migrate For Free

How to Fix Error Code 520 (13)How to Fix Error Code 520 (14) How to Fix Error Code 520 (15)


How to Fix Error Code 520 (2024)

FAQs

How to Fix Error Code 520? ›

Error 520 is a server-side error caused by a connection issue between the web server and the origin server. Try refreshing the page, clearing your browser cache and cookies, contacting your hosting provider or website administrator, and checking your server's logs for any issues to prevent this error.

How to resolve 520 error? ›

Error 520 is a server-side error caused by a connection issue between the web server and the origin server. Try refreshing the page, clearing your browser cache and cookies, contacting your hosting provider or website administrator, and checking your server's logs for any issues to prevent this error.

What is error 520 on Chrome? ›

The 520 error occurs when the origin web server initiates a connection but fails to finalize the request. This often happens if a program, cron job, or resource excessively consumes server resources, preventing it from adequately responding to all incoming requests.

What is a 520 network error? ›

A 520 error occurs when the connection started on the origin web server, but that the request was not completed. The most common reason why this would occur … This topic was automatically closed 15 days after the last reply.

What does code 520 mean? ›

What Is Error 520? Error 520 is a Cloudflare error message indicating that the origin web server received an invalid or incorrectly interpreted request, resulting in an empty response.

How do I fix a website error code? ›

General recommendations
  1. Ensure the scripts are uploaded in the correct mode — ASCII or Binary. ...
  2. Check your file or directory's (folder's) permission ( chmod ) values. ...
  3. If you've added some additional configurations to your . ...
  4. Add timeout rules directly to your PHP scripts to prevent your PHP code from timing out.

How to fix Cloudflare issue? ›

Resolution
  1. Ensure your origin web server is responsive.
  2. Review origin web server error logs to identify web server application crashes or outages.
  3. Confirm Cloudflare IP addresses are not blocked or rate limited.
  4. Allow all Cloudflare IP ranges in your origin web server's firewall or other security software.

How do I fix Chrome error code? ›

error message on Google Chrome:
  1. #1. Reload The Page You're Trying To Visit. ...
  2. #2. Close All Other Tabs / Open An Incognito Tab. ...
  3. #3. Check For An Unstable Internet Connection. ...
  4. #4. Clear Cache And Cookies. ...
  5. #5. Disable Browser Extensions. ...
  6. #6. Update Google Chrome. ...
  7. #7. Restart Your Device. ...
  8. #8. Disable Antivirus (Temporarily)
Jan 18, 2024

How do I get rid of errors on Google Chrome? ›

Delete your cache and cookies
  1. At the top right, click More. Delete browsing data.
  2. Next to "Time range," select All time.
  3. Select Cached images and files and Cookies and other site data. Deselect the other types of data.
  4. Click Delete data.
  5. Try reloading the tab with the error.

How do I reset Chrome errors? ›

“ERR_CONNECTION_RESET” FAQs

Try checking your network connection, restarting your router, clearing your browser cache and cookies, or disabling any VPN or proxy services to prevent an “ERR_CONNECTION_RESET” error. Another option is to try temporarily disabling any antivirus or firewall software.

What is a bad gateway 520? ›

A 502 bad gateway error is an HTTP status code that indicates a communication error between two web servers. You can receive this error when visiting a website that gets an invalid response from its host server or experiences other issues, such as server overloads, network problems, and configuration issues.

How do I reset my network error? ›

Network reset removes any network adapters you have installed and the settings for them. After your PC restarts, any network adapters are reinstalled, and the settings for them are set to the defaults. Select Start > Settings > Network & internet > Advanced network settings > Network reset.

How can I fix a network error? ›

Often you can:
  1. Unplug the router from the electrical outlet and make sure the lights on the router go out.
  2. Wait 30 seconds.
  3. Plug the router back in and wait 30 seconds for all the lights to come back on.

How to solve error 520? ›

Resolving common reasons for Error 520
  1. Restart PHP/Apache/Nginx. ...
  2. Whitelist Cloudflare IPs. ...
  3. Adjust TCP idle timeouts. ...
  4. Reduce header size. ...
  5. Empty response header. ...
  6. Temporarily disable Cloudflare. ...
  7. Activate development mode. ...
  8. Checking your server's error logs.
Feb 7, 2024

What is 520 in code? ›

The 520 area code covers much of southern Arizona, including the cities of Tucson, Sierra Vista, and Yuma.

What does 520 mean? ›

The term 520, an abbreviation for May 20, denotes an unofficial Valentine's Day in China. The number “520” phonetically resembles “Wo Ai Ni” or “I Love You” in Chinese.

What is error 520 on DDOS? ›

Technical Explanation of Error 520

If the origin server's response is unexpected, invalid, or malformed, Cloudflare responds with a 520 status code. The unexpected response could be due to various reasons, including server misconfigurations, crashes, or network issues.

What is error 520 on safari? ›

Accessing a URL using Safari or make.com results in a 520 error from Cloudflare, accessing the same URL from Chrome or cURL produces the correct result. The reason for the 520 is that the request crashes the apache server on the origin server with a Segmentation Fault.

How to resolve Java script error? ›

How to Troubleshoot and Fix Javascript Errors
  1. Check your antivirus software and create an exception for the app you're installing.
  2. Delete the app data from your computer and uninstall the app before downloading it again.
  3. Repair the Windows Visual C++ in your system app settings.
  4. Try running the app as an administrator.

What is error 520 on HP startup? ›

Sure Start RTID (520)

An HP Sure Start Runtime Intrusion detection event was detected. The most common cause of this error is a security issue, such as a hacking attempt. This could indicate a defective memory module. If the issue persists, update the BIOS, and then contact your IT administrator or HP Support.

References

Top Articles
Cindie's - Arlington Photos
Subnautica Nuclear Reactor Fragment Locations
Faint Citrine Lost Ark
Ingles Weekly Ad Lilburn Ga
Hotels Near 500 W Sunshine St Springfield Mo 65807
DIN 41612 - FCI - PDF Catalogs | Technical Documentation
Craigslist Jobs Phoenix
Items/Tm/Hm cheats for Pokemon FireRed on GBA
Shooting Games Multiplayer Unblocked
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Top tips for getting around Buenos Aires
Carolina Aguilar Facebook
Gia_Divine
Welcome to GradeBook
Craigslist Clinton Ar
Ezel Detailing
Joan M. Wallace - Baker Swan Funeral Home
Reborn Rich Kissasian
Jeffers Funeral Home Obituaries Greeneville Tennessee
Okc Body Rub
Breckiehill Shower Cucumber
Violent Night Showtimes Near Amc Dine-In Menlo Park 12
Bra Size Calculator & Conversion Chart: Measure Bust & Convert Sizes
Grave Digger Wynncraft
What is Software Defined Networking (SDN)? - GeeksforGeeks
Eegees Gift Card Balance
Craig Woolard Net Worth
Red Sox Starting Pitcher Tonight
Egg Crutch Glove Envelope
Hypixel Skyblock Dyes
Gas Prices In Henderson Kentucky
Metro 72 Hour Extension 2022
Ticketmaster Lion King Chicago
450 Miles Away From Me
Vivek Flowers Chantilly
Frcp 47
Elizaveta Viktorovna Bout
Merkantilismus – Staatslexikon
Gun Mayhem Watchdocumentaries
Torrid Rn Number Lookup
Hkx File Compatibility Check Skyrim/Sse
Exploring the Digital Marketplace: A Guide to Craigslist Miami
Craigslist/Nashville
Az Unblocked Games: Complete with ease | airSlate SignNow
Yale College Confidential 2027
Sea Guini Dress Code
Ajpw Sugar Glider Worth
Race Deepwoken
Colin Donnell Lpsg
Www.homedepot .Com
Msatlantathickdream
Best brow shaping and sculpting specialists near me in Toronto | Fresha
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 5943

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.