When your site’s visitors see error 520 in their browser, it means Cloudflare is sending the message because your server returned an empty, unknown, or unexpected response.
The 520 error can be approached through troubleshooting first to find the cause and then fixed following these steps.
Let’s jump right in:
Troubleshooting Error 520
Since the 520 error is coming up because of an issue on your server, you can troubleshoot the issue by looking in your error log.

Disable Cloudflare
Before you start troubleshooting, it’s necessary to disable Cloudflare. This helps isolate the problem by ensuring the issue can be replicated without Cloudflare being a factor.
Step 1
Start by logging into Cloudflare. Then, find your site on the list and click on it.

Step 2
Next, click on the DNS tab, then on the orange cloud under the Proxy status section in the table. You’ll know Cloudflare was disabled because the cloud will have turned gray.

Pause Cloudflare
Alternatively, you can choose to pause Cloudflare after logging in.
Step 1
Click on your connected site from the list.

Step 2
Then, scroll down until you see the Advanced Actions section in the sidebar. Click on the Pause Cloudflare on Site link.

Step 3
A pop-up will be displayed on the page that asks you to confirm you want to pause Cloudflare. Go ahead and click the Confirm button.

Go into Development Mode
If you don’t want to pause or disable Cloudflare, you can keep it running, but place it in development mode so you can still troubleshoot error 520.
Step 1
After logging into Cloudflare, click the Caching tab toward the top of the page.

Step2
Next, scroll down to the Development Mode section and click the Off toggle button. It should now say “On.”

Checking Your Server’s Error Logs
Now that you have disabled, paused or put Cloudflare into development mode, you can troubleshoot error 520 by checking your server’s error logs.
Finding your error log can vary between hosts so check with yours if you’re unsure of where to find your error logs.
If your hosting provider uses cPanel, you can follow the steps below.
Step 1
Log into cPanel and in the dashboard, go to the Metrics section. Then, click the Errors button.

Step 2
The error log page displays errors in reverse chronological order as well as up to 300 of the most recent messages. The error log may display more messages if you or your host adjusted the settings.

Checking Your Log for Error 520 Using MyKinsta
If you host your WordPress site with Kinsta, you can follow the steps below to check your error log.
Step 1
Log into MyKinsta and click on Sites in the menu on the left. Then, select the site you want to troubleshoot from the list on the page.

Step 2
Click on the Logs tab. By default, the error log is displayed. If you don’t see anything listed, it’s due to the fact that no errors on your site have occurred.

How to Interpret the Error Log
Each message in an error log has a structure. If you understand it, you can interpret the error messages that come up.
[Fri Oct 11 17:00:30 2019] [error] [client 123.4.56.7] error description: /path/to/file/with/error
The date and time of the message are listed first followed by the LogLevel directive which tells you about the severity level of the message.
Next up is the IP address of the client. This is who made the issue appear.
Finally, the actual message is displayed and may contain a path to the affected file.
Here are the LogLevel severity levels which could be listed in your error log’s messages:
- Emerg – This lets you know the issue is an emergency and the server is unavailable.
- Alert – Action should be taken immediately if you see this level.
- Crit – This denotes a critical condition.
- Error – This means an error has occurred.
- Warn – A message with this level is a warning about an issue that requires your attention, but isn’t critical.
- Notice – This means your server is normal, but there are significant details about the condition of your server that is available.
- Info – General information is available with this level.
- Debug – These messages contain details when you have debugging enabled.
Use a cURL Command to Troubleshoot Error 520
You can also use a cURL command to troubleshoot error 520 by testing against the origin server.
curl -vso /dev/null --user-agent "Mozilla 5.0" -H "Host: your-site.com" http://123.45.6.789/wp-login.php
Be sure to change “you-site.com” to your actual domain. You also need to update “123.45.6.789” with your site’s IP address. If you changed your login page, you should also change the “wp-login.php” part.
A successful response header would look similar to the example below:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Day, DD, Month Year Hour:Minute:Second Timezone
{ [12345 bytes data]
* Connection #0 to host 123.45.6.789 left intact
If you see something like this, it means everything’s okay and the site was reached without an error 520 response.
On the other hand, if you see a response header similar to the example below, it means the 520 error has occurred when Cloudflare was active:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
* Empty reply from server
* Connection #0 to host 123.45.6.789 left intact
How to Generate a HAR File
A HAR is an HTTP archive file. It contains archives for requests that are going to the server of origin and also through Cloudflare.
It can help you with troubleshooting because it compares response headers coming from the origin server and Cloudflare when it’s used as a proxy.
It’s also used to confirm that the headers are too large if that’s why error 520 has appeared.
You can create a HAR file with your browser with the steps below:
Chrome
Step 1
Open your browser and right-click on the page. Then, select Inspect.

Step 2
Once the panel has opened, click the Network tab and make sure there’s a red circle button toward the top, left-hand side of the panel. If it’s gray, click it.

Step 3
Check the Preserve log option next to the record button and then click the clear button.

Step 4
Load the page that’s bringing up error 520. Then, right-click anywhere in the messages area of the Chrome developer tool.
Select the Save as HAR with Content and save the file to your computer.

Firefox
Step 1
Open Firefox and right-click anywhere on the page. Then, select Inspect Element.

Step 2
Go to the Network tab and visit the page that has the 520 error coming up. Right-click on messages in the panel and select the Save All as HAR option.
Save the file to your computer.

Edge
Step 1
Open the Edge browser and right-click the page. Select Inspect from the list.

Step 2
Go to the Network tab and ensure the circular record button is red. If it’s not, click it. Check the Preserve log option, then the icon to clear the current messages.

Step 3
Go to the page where you’re experiencing error 520. Then, right-click on the messages in the developer tool panel and select the Save all as HAR with content option.
Save the file to your computer.
Safari
Step 1
Open Safari and right-click on the page for Windows or press CMD on your keyboard and click for Mac. Select Inspect Element from the list.

Step 2
Go to the Network tab. Check the Preserve Log option, then go to the page with the error 520 issue.

Step 3
Click the Export button and save the HAR file to your computer.

Resolving the Common Reasons for Error 520
Now that you have your error log, search through it and see if you notice any one of the issues below. Then, follow the steps below to resolve the issue.
Origin Server PHP Application Crashed
One common issue that causes error 520 is that one of the PHP applications have crashed on your server. Restarting PHP will fix the error.
Step 1
Using SSH, you can enter the command below for Apache servers:
apache2ctl restart
For Nginx servers, you can restart PHP using the command below:
service nginx restart
Restart PHP in MyKinsta
If your site is hosted with Kinsta, you can restart PHP in a few clicks.
Step 1
Log into MyKinsta and click on Sites on the left. Then, click on your site from the list.

Step 2
Go to the Tools tab and click the Restart PHP button.

Cloudflare IP Addresses Aren’t Whitelisted
Another reason why the 520 error can occur is if Cloudflare’s IP addresses aren’t whitelisted. You can whitelist them, but the steps vary between hosting providers.
If you’re not sure how to whitelist IPs, contact your host, especially if you don’t find any settings for it.
At Kinsta, Cloudflare’s IP addresses are whitelisted by default so there’s no need to worry about this cause of the error. It also won’t impact the other reasons why the error occurs.
TCP Idle Timeouts Are Shorter Than 300 Seconds
The Transmission Control Protocol (TCP) could also be the cause of error 520.
TCP is a standard protocol that establishes and maintains a network connection. If the TCP is set to timeout in under 300 seconds, it could cause the 520 error to pop up.
You can change the TCP service timeout using a CLI command:
set service Service-HTTP-1 -svrTimeout 500
Headers Exceed 8 KB
This issue is typically due to too many cookies or cookies that are too large. The HAR file that you downloaded during the troubleshooting process will show you if this is the problem.
Cloudflare has a limit of 8 KB that can be used for headers.
If you authored a plugin that requires too many cookies or has too much data in its cookies, try to reduce them. Or, if you’re using a lot of plugins that all need cookies, remove some of them (you should always use quality plugins).
Elementor Users
When you try to edit your WordPress site using Elementor and you get the 520 error – “Web server is returning an unknown error” – you can check the following.
First, you can try a different web browser.
If the problem still exists and your site is behind Cloudflare you may have a problem with Cloudflare’s Rocket Loader feature.
The issue was caused by Rocket Loader automatically changing the scripts to load asynchronously, which breaks the site editor and prevents you making changes.
By creating rules in Cloudflare you can solve this issue.
For Elementor pages: Site URL/*elementor*
For Elementor templates: Site URL/?elementor_library=*
Empty Response from Your Server
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are set correctly for your site’s domain.
The steps involved to check your settings depends on your DNS host. If your hosting plan has DNS bundled with it, then check with your hosting provider.
It may be important to note that if you updated your DNS settings, it may take up to 72 hours for your site to propagate. This means your site may be unavailable for up to three days.
After changing your DNS settings, you need to clear your site’s cache. If you have a caching plugin installed on your WordPress site, you can check its documentation if you’re unsure of how to clear your site’s cache from the plugin’s settings.
You can also clear your site’s cache through your hosting provider. Be sure to check with them if you need to know how to do this for your site.
If your site is hosted with Kinsta, you can click Sites in the menu, then on your listed site.
Then, click the Tools tab and click the Clear cache button.

If you have updated your DNS settings, your site is available again, you cleared your site’s cache and you still are experiencing error 520, restart your server.
If you don’t find the option in your settings, contact Kinsta’s support team and we’ll help you with this.
Missing Response Headers
According to Mozilla,
“A response header is an HTTP header that can be used in an HTTP response and that doesn’t relate to the content of the message. Response headers, like Age, Location or Server are used to give a more detailed context of the response.”
Missing response headers can be caused by a multitude of reasons.
Your best bet with this issue is to use a debugging tool like Fiddler to debug the issue and see exactly what the problem is so you can fix it.
Server not Returning Proper HTTP Error Responses
When your server sent an invalid error response, it could have caused the 520 error. This means the message didn’t fit in with the standard list of HTTP response codes.
It’s caused by your server or it could also be something on your server such as PHP applications or possibly plugins used on your WordPress site.
If you can’t find the source for the improper error code to fix it, try contacting support for further help.
Enabling Cloudflare Again
Check to see if you receive the error again. If you do, keep Cloudflare disabled and continue troubleshooting.
If the 520 error has been resolved, enable Cloudflare again.
Step 1
To do this, log into Cloudflare and if you disabled Cloudflare by turning the cloud gray in your account, start by selecting your site from the list.

Step 2
Click the DNS tab, then click the gray cloud to re-enable Cloudflare.

Restoring Cloudflare After Pausing It
Step 1
If you paused Cloudflare earlier, restore it by logging into Cloudflare and click on your listed site in the dashboard.

Step 2
Then, go to the Overview tab and scroll down to the bottom of the page until you see the Advanced Actions sections in the sidebar on the right-hand side of the page.
Click the Enable Cloudflare on Site link.

Turning off Development Mode
Step 1
If you have previously turned on Cloudflare’s development mode, you can turn it off by logging in. Then, click your site that’s listed on the page.

Step 2
Next, go to the Caching tab.

Step 3
Scroll down to the Development Mode section and click the toggle button that’s currently set to “On.”

What to Do If All Else Fails
If you’re still seeing issues, contact Cloudflare support.
Provide them with the following details:
- Full URL(s) of the requested resource when the error occurred.
- Cloudflare’s Ray ID from the page where you saw the error 520 message.
- The output from http://your-site.com/cdn-cgi/trace, but be sure to replace “your-site.com” with your actual domain name.
- Two HAR files: One from when Cloudflare was enabled for your site and one more from when you had Cloudflare disabled.
Is #Cloudflare giving you the Error 520? Here’s how to troubleshoot it and get this issue fixed! 🌧️🌈Click to Tweet
Summary
The 520 error can seem confusing, especially since it’s a Cloudflare error. But, it has to do with an error with your server that causes Cloudflare to not connect.
The steps above are the solutions to the most common causes of error 520. If you’re still having issues after trying them, you might want to contact Cloudflare or your hosting support.
Suggested reading: How to Set up Cloudflare APO for WordPress.
Ошибки 520, 521, 522, 524 могут появляться на сайте в том случае, если вы используете для своего сайта сервисы Cloudflare. Cloudflare — сервис, перенаправляющий трафик. Он позволяет увеличить скорость загрузки сайта и обеспечивает защиту от хакерских и DDoS-атак.
Ошибка 520 (Web server is returning an unknown error)
Если Cloudflare не удается обработать ответ сервера, на котором размещен сайт, то он выдает эту ошибку.
Причины появления ошибки 520
- Разрыв соединения, когда запрос к серверу был успешным.
- Превышение размера заголовка запроса (больше 8 КБ).
- Ответ сервера не содержит информацию.
- Ответ сервера некорректен.
Способы устранения ошибки 520 Web server is returning an unknown error
Если любое из вышеперечисленных условий исходит от веб-сервера, на котором размещен сайт, нужно обратиться в техподдержку хостинг-провайдера.
Правила ограничения скорости Cloudflare или другие запросы фильтрации иногда могут вызывать проблемы в работе сайта. Важно проверить и протестировать ваш сайт после подключения сервисов Cloudflare. Если на сервере хостинга используются системы безопасности, блокирующие запросы к сайту, обязательно укажите IP-адреса Cloudflare в белом списке, чтобы исключить вероятность блокировки запросов.
Список диапазонов IP-адресов Cloudflare
Ошибка 521 (Web Server Is Down)
Браузер показывает ошибку 521, когда веб-сервер неожиданно обрывает соединение с Cloudflare.
Причины появления ошибки 521
- Невозможно получить ответ от сервера.
- Система безопасности веб-сервера внесла запросы Cloudflare в черный список. Это связано с тем, что система работает по принципу обратного прокси-сервера. Ваша система безопасности могла принять периодические подключения от статических IP-адресов за DDoS-атаку. Из-за этого адреса блокируются или ограничиваются по скорости.
Способы устранения ошибки 521 Web Server Is Down
Возможно, веб-сервер отключен или работает с перебоями. В таком случае:
- Убедитесь, что ваш веб-сервер работает нормально.
- Просмотрите журналы ошибок сервера, чтобы выявить причину ошибки.
Если веб-сервер или хостинг-провайдер блокируют запросы Cloudflare, внесите в белый список все диапазоны IP-адресов сервиса в брандмауэре сервера или другом программном обеспечении безопасности.
Ошибка 522 (Connection timed out)
Появляется в случае, когда превышено время ожидания ответа от веб-сервера.
Причины появления ошибки 522
- Веб-сервер не может ответить на запрос из-за высокой загруженности.
- Система защиты веб-сервера блокирует запросы Cloudflare.
- Нет доступа к веб-серверу.
-
Некорректно указаны настройки DNS на Cloudflare: запросы отправляются по другому адресу.
-
Неверная настройка маршрутизации между Cloudflare и веб-сервером.
Способы устранения ошибки 522 Connection timed out
Убедитесь, что:
- IP-адреса Cloudflare не блокируются в брандмауэре.
- Ваш хостинг-провайдер не ограничивает скорость и не блокирует запросы от Cloudflare.
- Веб-сервер не перегружен.
Неисправную маршрутизацию в сети между Cloudflare и исходным веб-сервером устранить сложнее. Прежде чем перейти к этому пункту, исключите предыдущие. Если вы считаете, что причиной могут быть проблемы с сетью, отправьте заявку в службу поддержки Cloudflare.
Ошибка 524 (A timeout occurred)
Браузер покажет эту страницу, когда подключение к веб-серверу будет установлено, но его ответ превысит лимит ожидания. Cloudflare ожидает HTTP-ответ в течение 100 секунд.
Причины появления ошибки 524
- Проблемы в работе PHP-скриптов или сбой базы данных.
- Высокая загруженность веб-сервера.
Способы устранения ошибки 524 A timeout occurred
Проверьте доступные ресурсы веб-сервера, включая процессор, оперативную память и общий уровень трафика. Высокий уровень использования памяти память или высокая загрузка процессора могут сигнализировать о проблеме с ресурсами.
Если вы регулярно отправляете HTTP-запросы, выполнение которых занимает более 100 секунд (например, экспорт больших данных), рассмотрите возможность перемещения этих длительных процессов в поддомен, который не проксируется Cloudflare.
Служба поддержки RU-CENTER не оказывает техническую поддержку по сервису Cloudflare. Для устранения ошибок, пожалуйста, обратитесь в техническую поддержку Cloudflare. Если неполадки в работе сайта связаны с хостингом RU-CENTER, пожалуйста, отправьте заявку в нашу службу технической поддержки.
Туториал: как исправить ошибки сервера
Ошибки 520, 521, 522, 524 могут появляться на сайте в том случае, если вы используете для своего сайта сервисы Cloudflare. Cloudflare — сервис, перенаправляющий трафик. Он позволяет увеличить скорость загрузки сайта и обеспечивает защиту от хакерских и DDoS-атак.
Если Cloudflare не удается обработать ответ сервера, на котором размещен сайт, то он выдает эту ошибку.
Причины появления ошибки 520
- Разрыв соединения, когда запрос к серверу был успешным.
- Превышение размера заголовка запроса (больше 8 КБ).
- Ответ сервера не содержит информацию.
- Ответ сервера некорректен.
Способы устранения ошибки 520 Web server is returning an unknown error
Если любое из вышеперечисленных условий исходит от веб-сервера, на котором размещен сайт, нужно обратиться в техподдержку хостинг-провайдера.
Правила ограничения скорости Cloudflare или другие запросы фильтрации иногда могут вызывать проблемы в работе сайта. Важно проверить и протестировать ваш сайт после подключения сервисов Cloudflare. Если на сервере хостинга используются системы безопасности, блокирующие запросы к сайту, обязательно укажите IP-адреса Cloudflare в белом списке, чтобы исключить вероятность блокировки запросов.
Список диапазонов IP-адресов Cloudflare
Ошибка 521 (Web Server Is Down)
Браузер показывает ошибку 521, когда веб-сервер неожиданно обрывает соединение с Cloudflare.
Причины появления ошибки 521
- Невозможно получить ответ от сервера.
- Система безопасности веб-сервера внесла запросы Cloudflare в черный список. Это связано с тем, что система работает по принципу обратного прокси-сервера. Ваша система безопасности могла принять периодические подключения от статических IP-адресов за DDoS-атаку. Из-за этого адреса блокируются или ограничиваются по скорости.
Способы устранения ошибки 521 Web Server Is Down
Возможно, веб-сервер отключен или работает с перебоями. В таком случае:
- Убедитесь, что ваш веб-сервер работает нормально.
- Просмотрите журналы ошибок сервера, чтобы выявить причину ошибки.
Если веб-сервер или хостинг-провайдер блокируют запросы Cloudflare, внесите в белый список все диапазоны IP-адресов сервиса в брандмауэре сервера или другом программном обеспечении безопасности.
Ошибка 522 (Connection timed out)
Появляется в случае, когда превышено время ожидания ответа от веб-сервера.
Причины появления ошибки 522
- Веб-сервер не может ответить на запрос из-за высокой загруженности.
- Система защиты веб-сервера блокирует запросы Cloudflare.
- Нет доступа к веб-серверу.
-
Некорректно указаны настройки DNS на Cloudflare: запросы отправляются по другому адресу.
-
Неверная настройка маршрутизации между Cloudflare и веб-сервером.
Способы устранения ошибки 522 Connection timed out
Убедитесь, что:
- IP-адреса Cloudflare не блокируются в брандмауэре.
- Ваш хостинг-провайдер не ограничивает скорость и не блокирует запросы от Cloudflare.
- Веб-сервер не перегружен.
Неисправную маршрутизацию в сети между Cloudflare и исходным веб-сервером устранить сложнее. Прежде чем перейти к этому пункту, исключите предыдущие. Если вы считаете, что причиной могут быть проблемы с сетью, отправьте заявку в службу поддержки Cloudflare.
Ошибка 524 (A timeout occurred)
Браузер покажет эту страницу, когда подключение к веб-серверу будет установлено, но его ответ превысит лимит ожидания. Cloudflare ожидает HTTP-ответ в течение 100 секунд.
Причины появления ошибки 524
- Проблемы в работе PHP-скриптов или сбой базы данных.
- Высокая загруженность веб-сервера.
Способы устранения ошибки 524 A timeout occurred
Проверьте доступные ресурсы веб-сервера, включая процессор, оперативную память и общий уровень трафика. Высокий уровень использования памяти память или высокая загрузка процессора могут сигнализировать о проблеме с ресурсами.
Если вы регулярно отправляете HTTP-запросы, выполнение которых занимает более 100 секунд (например, экспорт больших данных), рассмотрите возможность перемещения этих длительных процессов в поддомен, который не проксируется Cloudflare.
Служба поддержки RU-CENTER не оказывает техническую поддержку по сервису Cloudflare. Для устранения ошибок, пожалуйста, обратитесь в техническую поддержку Cloudflare. Если неполадки в работе сайта связаны с хостингом RU-CENTER, пожалуйста, отправьте заявку в нашу службу технической поддержки.
Туториал: как исправить ошибки сервера
Ошибки 520, 521, 522, 524 связаны с проблемами в работе сервиса CloudFlare.
CloudFlare — сервис для перенаправления трафика на сайт с помощью облачного прокси-сервера, который обеспечивает дополнительную защиту от DDoS-атак и ускоряет загрузку вашего сайта.
Ошибка 520 Unknown Error
Что означает ошибка 520? Система CloudFlare выдаёт 520 ошибку, если не может обработать ответ от веб-сервера, на котором расположен сайт:
Причины появления ошибки:
- сброс соединения (после успешного запроса сервер разорвал соединение);
- заголовок запроса превышает ограничение размера заголовка Cloudflare (более 8 КБ). Если у вас много файлов cookie или они очень большие, это может привести к увеличению размера заголовков. Так как у Cloudflare есть ограничение на размер заголовка в 8 КБ, он не может обработать длинный заголовок;
- пустой ответ от сервера. Это происходит, когда DNS домена указывают на неправильный сервер.
- некорректный ответ от сервера;
- система безопасности блокирует запросы. Укажите IP-адреса Cloudflare в белом списке, чтобы система не блокировала запросы.
Способы устранения ошибки:
- Отключить CloudFlare. Так вы сможете понять, где находится ошибка (на сервере или в CloudFlare).
- Удалить плагины. Для плагинов иногда требуется много файлов cookies. Если на сайте много плагинов, это может повлиять на размер заголовков. Они могут быть слишком большими по размеру, и Cloudflare не справится с ними. Чтобы исправить ошибку, отключите плагины один за другим. Если ошибка пропадёт, удалите некоторые из плагинов.
- Проверьте настройки DNS в CloudFlare. Убедитесь, что запись A указывает на правильный IP-адрес.
Подробные рекомендации по исправлению ошибки 520 даны в справке CloudFlare.
Ошибка 521 Web Server Is Down
Код ошибки 521 возникает, когда веб-сервер обрывает соединение с CloudFlare:
Это может произойти в двух случаях:
- сервер не отвечает или недоступен. Необходимо проверить работоспособность сервера;
- веб-сервер блокирует запросы CloudFlare. Поскольку CloudFlare работает как обратный прокси-сервер, все запросы к серверам поступают от IP-адресов CloudFlare. Иногда система безопасности хостинга принимает постоянные подключения с одних и тех же IP-адресов за DDoS-атаку. В результате на IP-адреса CloudFlare накладывается блокировка/ограничения по скорости.
Диапазон IP-адресов CloudFlare вы можете увидеть по ссылке.
Рекомендации по исправлению ошибки 521 даны в справке CloudFlare.
Ошибка 522 Connection timed out
Ошибка 522 возникает, если превышено время ожидания ответа от веб-сервера и пользователь не может попасть на страницу:
Основные причины:
- веб-сервер перегружен и не ответил на запрос,
- на веб-сервере стоит система защиты, которая блокирует запросы от CloudFlare,
- веб-сервер недоступен,
- некорректный IP-адрес, установленный в настройках DNS на CloudFlare (Запрос от CloudFlare был отправлен на другой IP),
- проблемы с маршрутизацией сети между CloudFlare и веб-сервером.
Что делать? Для решения проблемы удостоверьтесь, что ваш веб-сервер активен и принимает HTTP-запросы. Проверьте, корректны ли настройки DNS в Личном кабинете на CloudFlare.
Подробные рекомендации по исправлению ошибки 522 даны в справке CloudFlare.
Как исправить ошибку 522 в Google Chrome
Методы решения:
- Очистите кеш браузера. Браузер может быть переполнен данными о посещении сайтов. Освободите место в кэше браузера по инструкции.
- Удалите расширение браузера, которое нарушает соединение с сервером. Отключайте расширения по очереди, чтобы найти то, которое выдает ошибку.
- Проверьте подключение к интернету. Низкая скорость интернета или перебои при подключении может повлиять на время получения ответа сервера. Из-за этого и появляется ошибка 522.
Как проверить подключение к интернету
-
1.
Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:
-
2.
Введите в командной строке:
Готово, вы получите сообщение с количеством переданных и полученных пакетов. Если потерянных пакетов нет, значит, у вас хорошее соединение с интернетом и проблема в другом. Если потерянные пакеты есть, свяжитесь с интернет-провайдером, чтобы улучшить интернет-соединение.
4. Очистите кеш DNS. Проблемы с соединением могут возникнуть из-за несоответствия IP-адреса сервера сайта в кэше компьютера с реальным адресом. Такое происходит, когда владельцы сайтов по какой-либо причине меняют IP-адреса сервера. Чтобы устранить эту проблему, воспользуйтесь инструкцией.
Ошибка 524 A timeout occurred
Ошибка 524 возникает, когда подключение с веб-сервером установлено, но он не ответил за установленное время ожидания соединения:
Время ожидания HTTP-ответа на CloudFlare — 100 секунд. Если веб-сервер не предоставил ответ, система выдаст 524 ошибку.
Основные причины:
- длительная работа PHP-процесса или запроса к базе данных;
- веб-сервер перегружен. Проверьте доступные ресурсы сервера, в том числе процессор и оперативную память.
Если вы регулярно выполняете тяжёлые запросы, которые могут занять больше 100 секунд, переместите эти процессы на субдомен, который не проксимируется в Cloudflare.
Рекомендации по исправлению ошибки 524 даны в справке CloudFlare.
Техническая поддержка
Специалисты REG.RU не оказывают техническую поддержку по сервису CloudFlare. Для устранения ошибки обратитесь в техническую поддержку CloudFlare. Если некорректная работа сайта связана с хостингом REG.RU, напишите заявку в службу технической поддержки.
Ошибки 520-524 требуют много знаний о сервере и его работе, поэтому самый верный способ решить проблему ― обратиться к хостинг-провайдеру, администратору сайта или к технической поддержке CloudFlare (если проблема на стороне их сервиса).
When your site’s visitors see error 520 in their browser, it means Cloudflare is sending the message because your server returned an empty, unknown, or unexpected response.
The 520 error can be approached through troubleshooting first to find the cause and then fixed following these steps.
Let’s jump right in:
Troubleshooting Error 520
Since the 520 error is coming up because of an issue on your server, you can troubleshoot the issue by looking in your error log.

Disable Cloudflare
Before you start troubleshooting, it’s necessary to disable Cloudflare. This helps isolate the problem by ensuring the issue can be replicated without Cloudflare being a factor.
Step 1
Start by logging into Cloudflare. Then, find your site on the list and click on it.

Step 2
Next, click on the DNS tab, then on the orange cloud under the Proxy status section in the table. You’ll know Cloudflare was disabled because the cloud will have turned gray.

Pause Cloudflare
Alternatively, you can choose to pause Cloudflare after logging in.
Step 1
Click on your connected site from the list.

Step 2
Then, scroll down until you see the Advanced Actions section in the sidebar. Click on the Pause Cloudflare on Site link.

Step 3
A pop-up will be displayed on the page that asks you to confirm you want to pause Cloudflare. Go ahead and click the Confirm button.

Go into Development Mode
If you don’t want to pause or disable Cloudflare, you can keep it running, but place it in development mode so you can still troubleshoot error 520.
Step 1
After logging into Cloudflare, click the Caching tab toward the top of the page.

Step2
Next, scroll down to the Development Mode section and click the Off toggle button. It should now say “On.”

Checking Your Server’s Error Logs
Now that you have disabled, paused or put Cloudflare into development mode, you can troubleshoot error 520 by checking your server’s error logs.
Finding your error log can vary between hosts so check with yours if you’re unsure of where to find your error logs.
If your hosting provider uses cPanel, you can follow the steps below.
Step 1
Log into cPanel and in the dashboard, go to the Metrics section. Then, click the Errors button.

Step 2
The error log page displays errors in reverse chronological order as well as up to 300 of the most recent messages. The error log may display more messages if you or your host adjusted the settings.

Checking Your Log for Error 520 Using MyKinsta
If you host your WordPress site with Kinsta, you can follow the steps below to check your error log.
Step 1
Log into MyKinsta and click on Sites in the menu on the left. Then, select the site you want to troubleshoot from the list on the page.

Step 2
Click on the Logs tab. By default, the error log is displayed. If you don’t see anything listed, it’s due to the fact that no errors on your site have occurred.

How to Interpret the Error Log
Each message in an error log has a structure. If you understand it, you can interpret the error messages that come up.
[Fri Oct 11 17:00:30 2019] [error] [client 123.4.56.7] error description: /path/to/file/with/error
The date and time of the message are listed first followed by the LogLevel directive which tells you about the severity level of the message.
Next up is the IP address of the client. This is who made the issue appear.
Finally, the actual message is displayed and may contain a path to the affected file.
Here are the LogLevel severity levels which could be listed in your error log’s messages:
- Emerg – This lets you know the issue is an emergency and the server is unavailable.
- Alert – Action should be taken immediately if you see this level.
- Crit – This denotes a critical condition.
- Error – This means an error has occurred.
- Warn – A message with this level is a warning about an issue that requires your attention, but isn’t critical.
- Notice – This means your server is normal, but there are significant details about the condition of your server that is available.
- Info – General information is available with this level.
- Debug – These messages contain details when you have debugging enabled.
Use a cURL Command to Troubleshoot Error 520
You can also use a cURL command to troubleshoot error 520 by testing against the origin server.
curl -vso /dev/null --user-agent "Mozilla 5.0" -H "Host: your-site.com" http://123.45.6.789/wp-login.php
Be sure to change “you-site.com” to your actual domain. You also need to update “123.45.6.789” with your site’s IP address. If you changed your login page, you should also change the “wp-login.php” part.
A successful response header would look similar to the example below:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Day, DD, Month Year Hour:Minute:Second Timezone
{ [12345 bytes data]
* Connection #0 to host 123.45.6.789 left intact
If you see something like this, it means everything’s okay and the site was reached without an error 520 response.
On the other hand, if you see a response header similar to the example below, it means the 520 error has occurred when Cloudflare was active:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
* Empty reply from server
* Connection #0 to host 123.45.6.789 left intact
How to Generate a HAR File
A HAR is an HTTP archive file. It contains archives for requests that are going to the server of origin and also through Cloudflare.
It can help you with troubleshooting because it compares response headers coming from the origin server and Cloudflare when it’s used as a proxy.
It’s also used to confirm that the headers are too large if that’s why error 520 has appeared.
You can create a HAR file with your browser with the steps below:
Chrome
Step 1
Open your browser and right-click on the page. Then, select Inspect.

Step 2
Once the panel has opened, click the Network tab and make sure there’s a red circle button toward the top, left-hand side of the panel. If it’s gray, click it.

Step 3
Check the Preserve log option next to the record button and then click the clear button.

Step 4
Load the page that’s bringing up error 520. Then, right-click anywhere in the messages area of the Chrome developer tool.
Select the Save as HAR with Content and save the file to your computer.

Firefox
Step 1
Open Firefox and right-click anywhere on the page. Then, select Inspect Element.

Step 2
Go to the Network tab and visit the page that has the 520 error coming up. Right-click on messages in the panel and select the Save All as HAR option.
Save the file to your computer.

Edge
Step 1
Open the Edge browser and right-click the page. Select Inspect from the list.

Step 2
Go to the Network tab and ensure the circular record button is red. If it’s not, click it. Check the Preserve log option, then the icon to clear the current messages.

Step 3
Go to the page where you’re experiencing error 520. Then, right-click on the messages in the developer tool panel and select the Save all as HAR with content option.
Save the file to your computer.
Safari
Step 1
Open Safari and right-click on the page for Windows or press CMD on your keyboard and click for Mac. Select Inspect Element from the list.

Step 2
Go to the Network tab. Check the Preserve Log option, then go to the page with the error 520 issue.

Step 3
Click the Export button and save the HAR file to your computer.

Resolving the Common Reasons for Error 520
Now that you have your error log, search through it and see if you notice any one of the issues below. Then, follow the steps below to resolve the issue.
Origin Server PHP Application Crashed
One common issue that causes error 520 is that one of the PHP applications have crashed on your server. Restarting PHP will fix the error.
Step 1
Using SSH, you can enter the command below for Apache servers:
apache2ctl restart
For Nginx servers, you can restart PHP using the command below:
service nginx restart
Restart PHP in MyKinsta
If your site is hosted with Kinsta, you can restart PHP in a few clicks.
Step 1
Log into MyKinsta and click on Sites on the left. Then, click on your site from the list.

Step 2
Go to the Tools tab and click the Restart PHP button.

Cloudflare IP Addresses Aren’t Whitelisted
Another reason why the 520 error can occur is if Cloudflare’s IP addresses aren’t whitelisted. You can whitelist them, but the steps vary between hosting providers.
If you’re not sure how to whitelist IPs, contact your host, especially if you don’t find any settings for it.
At Kinsta, Cloudflare’s IP addresses are whitelisted by default so there’s no need to worry about this cause of the error. It also won’t impact the other reasons why the error occurs.
TCP Idle Timeouts Are Shorter Than 300 Seconds
The Transmission Control Protocol (TCP) could also be the cause of error 520.
TCP is a standard protocol that establishes and maintains a network connection. If the TCP is set to timeout in under 300 seconds, it could cause the 520 error to pop up.
You can change the TCP service timeout using a CLI command:
set service Service-HTTP-1 -svrTimeout 500
Headers Exceed 8 KB
This issue is typically due to too many cookies or cookies that are too large. The HAR file that you downloaded during the troubleshooting process will show you if this is the problem.
Cloudflare has a limit of 8 KB that can be used for headers.
If you authored a plugin that requires too many cookies or has too much data in its cookies, try to reduce them. Or, if you’re using a lot of plugins that all need cookies, remove some of them (you should always use quality plugins).
Elementor Users
When you try to edit your WordPress site using Elementor and you get the 520 error – “Web server is returning an unknown error” – you can check the following.
First, you can try a different web browser.
If the problem still exists and your site is behind Cloudflare you may have a problem with Cloudflare’s Rocket Loader feature.
The issue was caused by Rocket Loader automatically changing the scripts to load asynchronously, which breaks the site editor and prevents you making changes.
By creating rules in Cloudflare you can solve this issue.
For Elementor pages: Site URL/*elementor*
For Elementor templates: Site URL/?elementor_library=*
Empty Response from Your Server
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are set correctly for your site’s domain.
The steps involved to check your settings depends on your DNS host. If your hosting plan has DNS bundled with it, then check with your hosting provider.
It may be important to note that if you updated your DNS settings, it may take up to 72 hours for your site to propagate. This means your site may be unavailable for up to three days.
After changing your DNS settings, you need to clear your site’s cache. If you have a caching plugin installed on your WordPress site, you can check its documentation if you’re unsure of how to clear your site’s cache from the plugin’s settings.
You can also clear your site’s cache through your hosting provider. Be sure to check with them if you need to know how to do this for your site.
If your site is hosted with Kinsta, you can click Sites in the menu, then on your listed site.
Then, click the Tools tab and click the Clear cache button.

If you have updated your DNS settings, your site is available again, you cleared your site’s cache and you still are experiencing error 520, restart your server.
If you don’t find the option in your settings, contact Kinsta’s support team and we’ll help you with this.
Missing Response Headers
According to Mozilla,
“A response header is an HTTP header that can be used in an HTTP response and that doesn’t relate to the content of the message. Response headers, like Age, Location or Server are used to give a more detailed context of the response.”
Missing response headers can be caused by a multitude of reasons.
Your best bet with this issue is to use a debugging tool like Fiddler to debug the issue and see exactly what the problem is so you can fix it.
Server not Returning Proper HTTP Error Responses
When your server sent an invalid error response, it could have caused the 520 error. This means the message didn’t fit in with the standard list of HTTP response codes.
It’s caused by your server or it could also be something on your server such as PHP applications or possibly plugins used on your WordPress site.
If you can’t find the source for the improper error code to fix it, try contacting support for further help.
Enabling Cloudflare Again
Check to see if you receive the error again. If you do, keep Cloudflare disabled and continue troubleshooting.
If the 520 error has been resolved, enable Cloudflare again.
Step 1
To do this, log into Cloudflare and if you disabled Cloudflare by turning the cloud gray in your account, start by selecting your site from the list.

Step 2
Click the DNS tab, then click the gray cloud to re-enable Cloudflare.

Restoring Cloudflare After Pausing It
Step 1
If you paused Cloudflare earlier, restore it by logging into Cloudflare and click on your listed site in the dashboard.

Step 2
Then, go to the Overview tab and scroll down to the bottom of the page until you see the Advanced Actions sections in the sidebar on the right-hand side of the page.
Click the Enable Cloudflare on Site link.

Turning off Development Mode
Step 1
If you have previously turned on Cloudflare’s development mode, you can turn it off by logging in. Then, click your site that’s listed on the page.

Step 2
Next, go to the Caching tab.

Step 3
Scroll down to the Development Mode section and click the toggle button that’s currently set to “On.”

What to Do If All Else Fails
If you’re still seeing issues, contact Cloudflare support.
Provide them with the following details:
- Full URL(s) of the requested resource when the error occurred.
- Cloudflare’s Ray ID from the page where you saw the error 520 message.
- The output from http://your-site.com/cdn-cgi/trace, but be sure to replace “your-site.com” with your actual domain name.
- Two HAR files: One from when Cloudflare was enabled for your site and one more from when you had Cloudflare disabled.
Is #Cloudflare giving you the Error 520? Here’s how to troubleshoot it and get this issue fixed! 🌧️🌈Click to Tweet
Summary
The 520 error can seem confusing, especially since it’s a Cloudflare error. But, it has to do with an error with your server that causes Cloudflare to not connect.
The steps above are the solutions to the most common causes of error 520. If you’re still having issues after trying them, you might want to contact Cloudflare or your hosting support.
Suggested reading: How to Set up Cloudflare APO for WordPress.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
When your site’s visitors see error 520 in their browser, it means Cloudflare is sending the message because your server returned an empty, unknown, or unexpected response.
The 520 error can be approached through troubleshooting first to find the cause and then fixed following these steps.
Let’s jump right in:
Troubleshooting Error 520
Since the 520 error is coming up because of an issue on your server, you can troubleshoot the issue by looking in your error log.

Disable Cloudflare
Before you start troubleshooting, it’s necessary to disable Cloudflare. This helps isolate the problem by ensuring the issue can be replicated without Cloudflare being a factor.
Step 1
Start by logging into Cloudflare. Then, find your site on the list and click on it.

Step 2
Next, click on the DNS tab, then on the orange cloud under the Proxy status section in the table. You’ll know Cloudflare was disabled because the cloud will have turned gray.

Pause Cloudflare
Alternatively, you can choose to pause Cloudflare after logging in.
Step 1
Click on your connected site from the list.

Step 2
Then, scroll down until you see the Advanced Actions section in the sidebar. Click on the Pause Cloudflare on Site link.

Step 3
A pop-up will be displayed on the page that asks you to confirm you want to pause Cloudflare. Go ahead and click the Confirm button.

Go into Development Mode
If you don’t want to pause or disable Cloudflare, you can keep it running, but place it in development mode so you can still troubleshoot error 520.
Step 1
After logging into Cloudflare, click the Caching tab toward the top of the page.

Step2
Next, scroll down to the Development Mode section and click the Off toggle button. It should now say “On.”

Checking Your Server’s Error Logs
Now that you have disabled, paused or put Cloudflare into development mode, you can troubleshoot error 520 by checking your server’s error logs.
Finding your error log can vary between hosts so check with yours if you’re unsure of where to find your error logs.
If your hosting provider uses cPanel, you can follow the steps below.
Step 1
Log into cPanel and in the dashboard, go to the Metrics section. Then, click the Errors button.

Step 2
The error log page displays errors in reverse chronological order as well as up to 300 of the most recent messages. The error log may display more messages if you or your host adjusted the settings.

Checking Your Log for Error 520 Using MyKinsta
If you host your WordPress site with Kinsta, you can follow the steps below to check your error log.
Step 1
Log into MyKinsta and click on Sites in the menu on the left. Then, select the site you want to troubleshoot from the list on the page.

Step 2
Click on the Logs tab. By default, the error log is displayed. If you don’t see anything listed, it’s due to the fact that no errors on your site have occurred.

How to Interpret the Error Log
Each message in an error log has a structure. If you understand it, you can interpret the error messages that come up.
[Fri Oct 11 17:00:30 2019] [error] [client 123.4.56.7] error description: /path/to/file/with/error
The date and time of the message are listed first followed by the LogLevel directive which tells you about the severity level of the message.
Next up is the IP address of the client. This is who made the issue appear.
Finally, the actual message is displayed and may contain a path to the affected file.
Here are the LogLevel severity levels which could be listed in your error log’s messages:
- Emerg – This lets you know the issue is an emergency and the server is unavailable.
- Alert – Action should be taken immediately if you see this level.
- Crit – This denotes a critical condition.
- Error – This means an error has occurred.
- Warn – A message with this level is a warning about an issue that requires your attention, but isn’t critical.
- Notice – This means your server is normal, but there are significant details about the condition of your server that is available.
- Info – General information is available with this level.
- Debug – These messages contain details when you have debugging enabled.
Use a cURL Command to Troubleshoot Error 520
You can also use a cURL command to troubleshoot error 520 by testing against the origin server.
curl -vso /dev/null --user-agent "Mozilla 5.0" -H "Host: your-site.com" http://123.45.6.789/wp-login.php
Be sure to change “you-site.com” to your actual domain. You also need to update “123.45.6.789” with your site’s IP address. If you changed your login page, you should also change the “wp-login.php” part.
A successful response header would look similar to the example below:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Day, DD, Month Year Hour:Minute:Second Timezone
{ [12345 bytes data]
* Connection #0 to host 123.45.6.789 left intact
If you see something like this, it means everything’s okay and the site was reached without an error 520 response.
On the other hand, if you see a response header similar to the example below, it means the 520 error has occurred when Cloudflare was active:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
* Empty reply from server
* Connection #0 to host 123.45.6.789 left intact
How to Generate a HAR File
A HAR is an HTTP archive file. It contains archives for requests that are going to the server of origin and also through Cloudflare.
It can help you with troubleshooting because it compares response headers coming from the origin server and Cloudflare when it’s used as a proxy.
It’s also used to confirm that the headers are too large if that’s why error 520 has appeared.
You can create a HAR file with your browser with the steps below:
Chrome
Step 1
Open your browser and right-click on the page. Then, select Inspect.

Step 2
Once the panel has opened, click the Network tab and make sure there’s a red circle button toward the top, left-hand side of the panel. If it’s gray, click it.

Step 3
Check the Preserve log option next to the record button and then click the clear button.

Step 4
Load the page that’s bringing up error 520. Then, right-click anywhere in the messages area of the Chrome developer tool.
Select the Save as HAR with Content and save the file to your computer.

Firefox
Step 1
Open Firefox and right-click anywhere on the page. Then, select Inspect Element.

Step 2
Go to the Network tab and visit the page that has the 520 error coming up. Right-click on messages in the panel and select the Save All as HAR option.
Save the file to your computer.

Edge
Step 1
Open the Edge browser and right-click the page. Select Inspect from the list.

Step 2
Go to the Network tab and ensure the circular record button is red. If it’s not, click it. Check the Preserve log option, then the icon to clear the current messages.

Step 3
Go to the page where you’re experiencing error 520. Then, right-click on the messages in the developer tool panel and select the Save all as HAR with content option.
Save the file to your computer.
Safari
Step 1
Open Safari and right-click on the page for Windows or press CMD on your keyboard and click for Mac. Select Inspect Element from the list.

Step 2
Go to the Network tab. Check the Preserve Log option, then go to the page with the error 520 issue.

Step 3
Click the Export button and save the HAR file to your computer.

Resolving the Common Reasons for Error 520
Now that you have your error log, search through it and see if you notice any one of the issues below. Then, follow the steps below to resolve the issue.
Origin Server PHP Application Crashed
One common issue that causes error 520 is that one of the PHP applications have crashed on your server. Restarting PHP will fix the error.
Step 1
Using SSH, you can enter the command below for Apache servers:
apache2ctl restart
For Nginx servers, you can restart PHP using the command below:
service nginx restart
Restart PHP in MyKinsta
If your site is hosted with Kinsta, you can restart PHP in a few clicks.
Step 1
Log into MyKinsta and click on Sites on the left. Then, click on your site from the list.

Step 2
Go to the Tools tab and click the Restart PHP button.

Cloudflare IP Addresses Aren’t Whitelisted
Another reason why the 520 error can occur is if Cloudflare’s IP addresses aren’t whitelisted. You can whitelist them, but the steps vary between hosting providers.
If you’re not sure how to whitelist IPs, contact your host, especially if you don’t find any settings for it.
At Kinsta, Cloudflare’s IP addresses are whitelisted by default so there’s no need to worry about this cause of the error. It also won’t impact the other reasons why the error occurs.
TCP Idle Timeouts Are Shorter Than 300 Seconds
The Transmission Control Protocol (TCP) could also be the cause of error 520.
TCP is a standard protocol that establishes and maintains a network connection. If the TCP is set to timeout in under 300 seconds, it could cause the 520 error to pop up.
You can change the TCP service timeout using a CLI command:
set service Service-HTTP-1 -svrTimeout 500
Headers Exceed 8 KB
This issue is typically due to too many cookies or cookies that are too large. The HAR file that you downloaded during the troubleshooting process will show you if this is the problem.
Cloudflare has a limit of 8 KB that can be used for headers.
If you authored a plugin that requires too many cookies or has too much data in its cookies, try to reduce them. Or, if you’re using a lot of plugins that all need cookies, remove some of them (you should always use quality plugins).
Elementor Users
When you try to edit your WordPress site using Elementor and you get the 520 error – “Web server is returning an unknown error” – you can check the following.
First, you can try a different web browser.
If the problem still exists and your site is behind Cloudflare you may have a problem with Cloudflare’s Rocket Loader feature.
The issue was caused by Rocket Loader automatically changing the scripts to load asynchronously, which breaks the site editor and prevents you making changes.
By creating rules in Cloudflare you can solve this issue.
For Elementor pages: Site URL/*elementor*
For Elementor templates: Site URL/?elementor_library=*
Empty Response from Your Server
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are set correctly for your site’s domain.
The steps involved to check your settings depends on your DNS host. If your hosting plan has DNS bundled with it, then check with your hosting provider.
It may be important to note that if you updated your DNS settings, it may take up to 72 hours for your site to propagate. This means your site may be unavailable for up to three days.
After changing your DNS settings, you need to clear your site’s cache. If you have a caching plugin installed on your WordPress site, you can check its documentation if you’re unsure of how to clear your site’s cache from the plugin’s settings.
You can also clear your site’s cache through your hosting provider. Be sure to check with them if you need to know how to do this for your site.
If your site is hosted with Kinsta, you can click Sites in the menu, then on your listed site.
Then, click the Tools tab and click the Clear cache button.

If you have updated your DNS settings, your site is available again, you cleared your site’s cache and you still are experiencing error 520, restart your server.
If you don’t find the option in your settings, contact Kinsta’s support team and we’ll help you with this.
Missing Response Headers
According to Mozilla,
“A response header is an HTTP header that can be used in an HTTP response and that doesn’t relate to the content of the message. Response headers, like Age, Location or Server are used to give a more detailed context of the response.”
Missing response headers can be caused by a multitude of reasons.
Your best bet with this issue is to use a debugging tool like Fiddler to debug the issue and see exactly what the problem is so you can fix it.
Server not Returning Proper HTTP Error Responses
When your server sent an invalid error response, it could have caused the 520 error. This means the message didn’t fit in with the standard list of HTTP response codes.
It’s caused by your server or it could also be something on your server such as PHP applications or possibly plugins used on your WordPress site.
If you can’t find the source for the improper error code to fix it, try contacting support for further help.
Enabling Cloudflare Again
Check to see if you receive the error again. If you do, keep Cloudflare disabled and continue troubleshooting.
If the 520 error has been resolved, enable Cloudflare again.
Step 1
To do this, log into Cloudflare and if you disabled Cloudflare by turning the cloud gray in your account, start by selecting your site from the list.

Step 2
Click the DNS tab, then click the gray cloud to re-enable Cloudflare.

Restoring Cloudflare After Pausing It
Step 1
If you paused Cloudflare earlier, restore it by logging into Cloudflare and click on your listed site in the dashboard.

Step 2
Then, go to the Overview tab and scroll down to the bottom of the page until you see the Advanced Actions sections in the sidebar on the right-hand side of the page.
Click the Enable Cloudflare on Site link.

Turning off Development Mode
Step 1
If you have previously turned on Cloudflare’s development mode, you can turn it off by logging in. Then, click your site that’s listed on the page.

Step 2
Next, go to the Caching tab.

Step 3
Scroll down to the Development Mode section and click the toggle button that’s currently set to “On.”

What to Do If All Else Fails
If you’re still seeing issues, contact Cloudflare support.
Provide them with the following details:
- Full URL(s) of the requested resource when the error occurred.
- Cloudflare’s Ray ID from the page where you saw the error 520 message.
- The output from http://your-site.com/cdn-cgi/trace, but be sure to replace “your-site.com” with your actual domain name.
- Two HAR files: One from when Cloudflare was enabled for your site and one more from when you had Cloudflare disabled.
Is #Cloudflare giving you the Error 520? Here’s how to troubleshoot it and get this issue fixed! 🌧️🌈Click to Tweet
Summary
The 520 error can seem confusing, especially since it’s a Cloudflare error. But, it has to do with an error with your server that causes Cloudflare to not connect.
The steps above are the solutions to the most common causes of error 520. If you’re still having issues after trying them, you might want to contact Cloudflare or your hosting support.
Suggested reading: How to Set up Cloudflare APO for WordPress.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
Ошибки 520, 521, 522, 524 связаны с проблемами в работе сервиса CloudFlare.
CloudFlare — сервис для перенаправления трафика на сайт с помощью облачного прокси-сервера, который обеспечивает дополнительную защиту от DDoS-атак и ускоряет загрузку вашего сайта.
Ошибка 520 Unknown Error
Что означает ошибка 520? Система CloudFlare выдаёт 520 ошибку, если не может обработать ответ от веб-сервера, на котором расположен сайт:
Причины появления ошибки:
- сброс соединения (после успешного запроса сервер разорвал соединение);
- заголовок запроса превышает ограничение размера заголовка Cloudflare (более 8 КБ). Если у вас много файлов cookie или они очень большие, это может привести к увеличению размера заголовков. Так как у Cloudflare есть ограничение на размер заголовка в 8 КБ, он не может обработать длинный заголовок;
- пустой ответ от сервера. Это происходит, когда DNS домена указывают на неправильный сервер.
- некорректный ответ от сервера;
- система безопасности блокирует запросы. Укажите IP-адреса Cloudflare в белом списке, чтобы система не блокировала запросы.
Способы устранения ошибки:
- Отключить CloudFlare. Так вы сможете понять, где находится ошибка (на сервере или в CloudFlare).
- Удалить плагины. Для плагинов иногда требуется много файлов cookies. Если на сайте много плагинов, это может повлиять на размер заголовков. Они могут быть слишком большими по размеру, и Cloudflare не справится с ними. Чтобы исправить ошибку, отключите плагины один за другим. Если ошибка пропадёт, удалите некоторые из плагинов.
- Проверьте настройки DNS в CloudFlare. Убедитесь, что запись A указывает на правильный IP-адрес.
Подробные рекомендации по исправлению ошибки 520 даны в справке CloudFlare.
Ошибка 521 Web Server Is Down
Код ошибки 521 возникает, когда веб-сервер обрывает соединение с CloudFlare:
Это может произойти в двух случаях:
- сервер не отвечает или недоступен. Необходимо проверить работоспособность сервера;
- веб-сервер блокирует запросы CloudFlare. Поскольку CloudFlare работает как обратный прокси-сервер, все запросы к серверам поступают от IP-адресов CloudFlare. Иногда система безопасности хостинга принимает постоянные подключения с одних и тех же IP-адресов за DDoS-атаку. В результате на IP-адреса CloudFlare накладывается блокировка/ограничения по скорости.
Диапазон IP-адресов CloudFlare вы можете увидеть по ссылке.
Рекомендации по исправлению ошибки 521 даны в справке CloudFlare.
Ошибка 522 Connection timed out
Ошибка 522 возникает, если превышено время ожидания ответа от веб-сервера и пользователь не может попасть на страницу:
Основные причины:
- веб-сервер перегружен и не ответил на запрос,
- на веб-сервере стоит система защиты, которая блокирует запросы от CloudFlare,
- веб-сервер недоступен,
- некорректный IP-адрес, установленный в настройках DNS на CloudFlare (Запрос от CloudFlare был отправлен на другой IP),
- проблемы с маршрутизацией сети между CloudFlare и веб-сервером.
Что делать? Для решения проблемы удостоверьтесь, что ваш веб-сервер активен и принимает HTTP-запросы. Проверьте, корректны ли настройки DNS в Личном кабинете на CloudFlare.
Подробные рекомендации по исправлению ошибки 522 даны в справке CloudFlare.
Как исправить ошибку 522 в Google Chrome
Методы решения:
- Очистите кеш браузера. Браузер может быть переполнен данными о посещении сайтов. Освободите место в кэше браузера по инструкции.
- Удалите расширение браузера, которое нарушает соединение с сервером. Отключайте расширения по очереди, чтобы найти то, которое выдает ошибку.
- Проверьте подключение к интернету. Низкая скорость интернета или перебои при подключении может повлиять на время получения ответа сервера. Из-за этого и появляется ошибка 522.
Как проверить подключение к интернету
-
1.
Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:
-
2.
Введите в командной строке:
Готово, вы получите сообщение с количеством переданных и полученных пакетов. Если потерянных пакетов нет, значит, у вас хорошее соединение с интернетом и проблема в другом. Если потерянные пакеты есть, свяжитесь с интернет-провайдером, чтобы улучшить интернет-соединение.
4. Очистите кеш DNS. Проблемы с соединением могут возникнуть из-за несоответствия IP-адреса сервера сайта в кэше компьютера с реальным адресом. Такое происходит, когда владельцы сайтов по какой-либо причине меняют IP-адреса сервера. Чтобы устранить эту проблему, воспользуйтесь инструкцией.
Ошибка 524 A timeout occurred
Ошибка 524 возникает, когда подключение с веб-сервером установлено, но он не ответил за установленное время ожидания соединения:
Время ожидания HTTP-ответа на CloudFlare — 100 секунд. Если веб-сервер не предоставил ответ, система выдаст 524 ошибку.
Основные причины:
- длительная работа PHP-процесса или запроса к базе данных;
- веб-сервер перегружен. Проверьте доступные ресурсы сервера, в том числе процессор и оперативную память.
Если вы регулярно выполняете тяжёлые запросы, которые могут занять больше 100 секунд, переместите эти процессы на субдомен, который не проксимируется в Cloudflare.
Рекомендации по исправлению ошибки 524 даны в справке CloudFlare.
Техническая поддержка
Специалисты REG.RU не оказывают техническую поддержку по сервису CloudFlare. Для устранения ошибки обратитесь в техническую поддержку CloudFlare. Если некорректная работа сайта связана с хостингом REG.RU, напишите заявку в службу технической поддержки.
Ошибки 520-524 требуют много знаний о сервере и его работе, поэтому самый верный способ решить проблему ― обратиться к хостинг-провайдеру, администратору сайта или к технической поддержке CloudFlare (если проблема на стороне их сервиса).
When your site’s visitors see error 520 in their browser, it means Cloudflare is sending the message because your server returned an empty, unknown, or unexpected response.
The 520 error can be approached through troubleshooting first to find the cause and then fixed following these steps.
Let’s jump right in:
Troubleshooting Error 520
Since the 520 error is coming up because of an issue on your server, you can troubleshoot the issue by looking in your error log.

Disable Cloudflare
Before you start troubleshooting, it’s necessary to disable Cloudflare. This helps isolate the problem by ensuring the issue can be replicated without Cloudflare being a factor.
Step 1
Start by logging into Cloudflare. Then, find your site on the list and click on it.

Step 2
Next, click on the DNS tab, then on the orange cloud under the Proxy status section in the table. You’ll know Cloudflare was disabled because the cloud will have turned gray.

Pause Cloudflare
Alternatively, you can choose to pause Cloudflare after logging in.
Step 1
Click on your connected site from the list.

Step 2
Then, scroll down until you see the Advanced Actions section in the sidebar. Click on the Pause Cloudflare on Site link.

Step 3
A pop-up will be displayed on the page that asks you to confirm you want to pause Cloudflare. Go ahead and click the Confirm button.

Go into Development Mode
If you don’t want to pause or disable Cloudflare, you can keep it running, but place it in development mode so you can still troubleshoot error 520.
Step 1
After logging into Cloudflare, click the Caching tab toward the top of the page.

Step2
Next, scroll down to the Development Mode section and click the Off toggle button. It should now say “On.”

Checking Your Server’s Error Logs
Now that you have disabled, paused or put Cloudflare into development mode, you can troubleshoot error 520 by checking your server’s error logs.
Finding your error log can vary between hosts so check with yours if you’re unsure of where to find your error logs.
If your hosting provider uses cPanel, you can follow the steps below.
Step 1
Log into cPanel and in the dashboard, go to the Metrics section. Then, click the Errors button.

Step 2
The error log page displays errors in reverse chronological order as well as up to 300 of the most recent messages. The error log may display more messages if you or your host adjusted the settings.

Checking Your Log for Error 520 Using MyKinsta
If you host your WordPress site with Kinsta, you can follow the steps below to check your error log.
Step 1
Log into MyKinsta and click on Sites in the menu on the left. Then, select the site you want to troubleshoot from the list on the page.

Step 2
Click on the Logs tab. By default, the error log is displayed. If you don’t see anything listed, it’s due to the fact that no errors on your site have occurred.

How to Interpret the Error Log
Each message in an error log has a structure. If you understand it, you can interpret the error messages that come up.
[Fri Oct 11 17:00:30 2019] [error] [client 123.4.56.7] error description: /path/to/file/with/error
The date and time of the message are listed first followed by the LogLevel directive which tells you about the severity level of the message.
Next up is the IP address of the client. This is who made the issue appear.
Finally, the actual message is displayed and may contain a path to the affected file.
Here are the LogLevel severity levels which could be listed in your error log’s messages:
- Emerg – This lets you know the issue is an emergency and the server is unavailable.
- Alert – Action should be taken immediately if you see this level.
- Crit – This denotes a critical condition.
- Error – This means an error has occurred.
- Warn – A message with this level is a warning about an issue that requires your attention, but isn’t critical.
- Notice – This means your server is normal, but there are significant details about the condition of your server that is available.
- Info – General information is available with this level.
- Debug – These messages contain details when you have debugging enabled.
Use a cURL Command to Troubleshoot Error 520
You can also use a cURL command to troubleshoot error 520 by testing against the origin server.
curl -vso /dev/null --user-agent "Mozilla 5.0" -H "Host: your-site.com" http://123.45.6.789/wp-login.php
Be sure to change “you-site.com” to your actual domain. You also need to update “123.45.6.789” with your site’s IP address. If you changed your login page, you should also change the “wp-login.php” part.
A successful response header would look similar to the example below:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Day, DD, Month Year Hour:Minute:Second Timezone
{ [12345 bytes data]
* Connection #0 to host 123.45.6.789 left intact
If you see something like this, it means everything’s okay and the site was reached without an error 520 response.
On the other hand, if you see a response header similar to the example below, it means the 520 error has occurred when Cloudflare was active:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
* Empty reply from server
* Connection #0 to host 123.45.6.789 left intact
How to Generate a HAR File
A HAR is an HTTP archive file. It contains archives for requests that are going to the server of origin and also through Cloudflare.
It can help you with troubleshooting because it compares response headers coming from the origin server and Cloudflare when it’s used as a proxy.
It’s also used to confirm that the headers are too large if that’s why error 520 has appeared.
You can create a HAR file with your browser with the steps below:
Chrome
Step 1
Open your browser and right-click on the page. Then, select Inspect.

Step 2
Once the panel has opened, click the Network tab and make sure there’s a red circle button toward the top, left-hand side of the panel. If it’s gray, click it.

Step 3
Check the Preserve log option next to the record button and then click the clear button.

Step 4
Load the page that’s bringing up error 520. Then, right-click anywhere in the messages area of the Chrome developer tool.
Select the Save as HAR with Content and save the file to your computer.

Firefox
Step 1
Open Firefox and right-click anywhere on the page. Then, select Inspect Element.

Step 2
Go to the Network tab and visit the page that has the 520 error coming up. Right-click on messages in the panel and select the Save All as HAR option.
Save the file to your computer.

Edge
Step 1
Open the Edge browser and right-click the page. Select Inspect from the list.

Step 2
Go to the Network tab and ensure the circular record button is red. If it’s not, click it. Check the Preserve log option, then the icon to clear the current messages.

Step 3
Go to the page where you’re experiencing error 520. Then, right-click on the messages in the developer tool panel and select the Save all as HAR with content option.
Save the file to your computer.
Safari
Step 1
Open Safari and right-click on the page for Windows or press CMD on your keyboard and click for Mac. Select Inspect Element from the list.

Step 2
Go to the Network tab. Check the Preserve Log option, then go to the page with the error 520 issue.

Step 3
Click the Export button and save the HAR file to your computer.

Resolving the Common Reasons for Error 520
Now that you have your error log, search through it and see if you notice any one of the issues below. Then, follow the steps below to resolve the issue.
Origin Server PHP Application Crashed
One common issue that causes error 520 is that one of the PHP applications have crashed on your server. Restarting PHP will fix the error.
Step 1
Using SSH, you can enter the command below for Apache servers:
apache2ctl restart
For Nginx servers, you can restart PHP using the command below:
service nginx restart
Restart PHP in MyKinsta
If your site is hosted with Kinsta, you can restart PHP in a few clicks.
Step 1
Log into MyKinsta and click on Sites on the left. Then, click on your site from the list.

Step 2
Go to the Tools tab and click the Restart PHP button.

Cloudflare IP Addresses Aren’t Whitelisted
Another reason why the 520 error can occur is if Cloudflare’s IP addresses aren’t whitelisted. You can whitelist them, but the steps vary between hosting providers.
If you’re not sure how to whitelist IPs, contact your host, especially if you don’t find any settings for it.
At Kinsta, Cloudflare’s IP addresses are whitelisted by default so there’s no need to worry about this cause of the error. It also won’t impact the other reasons why the error occurs.
TCP Idle Timeouts Are Shorter Than 300 Seconds
The Transmission Control Protocol (TCP) could also be the cause of error 520.
TCP is a standard protocol that establishes and maintains a network connection. If the TCP is set to timeout in under 300 seconds, it could cause the 520 error to pop up.
You can change the TCP service timeout using a CLI command:
set service Service-HTTP-1 -svrTimeout 500
Headers Exceed 8 KB
This issue is typically due to too many cookies or cookies that are too large. The HAR file that you downloaded during the troubleshooting process will show you if this is the problem.
Cloudflare has a limit of 8 KB that can be used for headers.
If you authored a plugin that requires too many cookies or has too much data in its cookies, try to reduce them. Or, if you’re using a lot of plugins that all need cookies, remove some of them (you should always use quality plugins).
Elementor Users
When you try to edit your WordPress site using Elementor and you get the 520 error – “Web server is returning an unknown error” – you can check the following.
First, you can try a different web browser.
If the problem still exists and your site is behind Cloudflare you may have a problem with Cloudflare’s Rocket Loader feature.
The issue was caused by Rocket Loader automatically changing the scripts to load asynchronously, which breaks the site editor and prevents you making changes.
By creating rules in Cloudflare you can solve this issue.
For Elementor pages: Site URL/*elementor*
For Elementor templates: Site URL/?elementor_library=*
Empty Response from Your Server
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are set correctly for your site’s domain.
The steps involved to check your settings depends on your DNS host. If your hosting plan has DNS bundled with it, then check with your hosting provider.
It may be important to note that if you updated your DNS settings, it may take up to 72 hours for your site to propagate. This means your site may be unavailable for up to three days.
After changing your DNS settings, you need to clear your site’s cache. If you have a caching plugin installed on your WordPress site, you can check its documentation if you’re unsure of how to clear your site’s cache from the plugin’s settings.
You can also clear your site’s cache through your hosting provider. Be sure to check with them if you need to know how to do this for your site.
If your site is hosted with Kinsta, you can click Sites in the menu, then on your listed site.
Then, click the Tools tab and click the Clear cache button.

If you have updated your DNS settings, your site is available again, you cleared your site’s cache and you still are experiencing error 520, restart your server.
If you don’t find the option in your settings, contact Kinsta’s support team and we’ll help you with this.
Missing Response Headers
According to Mozilla,
“A response header is an HTTP header that can be used in an HTTP response and that doesn’t relate to the content of the message. Response headers, like Age, Location or Server are used to give a more detailed context of the response.”
Missing response headers can be caused by a multitude of reasons.
Your best bet with this issue is to use a debugging tool like Fiddler to debug the issue and see exactly what the problem is so you can fix it.
Server not Returning Proper HTTP Error Responses
When your server sent an invalid error response, it could have caused the 520 error. This means the message didn’t fit in with the standard list of HTTP response codes.
It’s caused by your server or it could also be something on your server such as PHP applications or possibly plugins used on your WordPress site.
If you can’t find the source for the improper error code to fix it, try contacting support for further help.
Enabling Cloudflare Again
Check to see if you receive the error again. If you do, keep Cloudflare disabled and continue troubleshooting.
If the 520 error has been resolved, enable Cloudflare again.
Step 1
To do this, log into Cloudflare and if you disabled Cloudflare by turning the cloud gray in your account, start by selecting your site from the list.

Step 2
Click the DNS tab, then click the gray cloud to re-enable Cloudflare.

Restoring Cloudflare After Pausing It
Step 1
If you paused Cloudflare earlier, restore it by logging into Cloudflare and click on your listed site in the dashboard.

Step 2
Then, go to the Overview tab and scroll down to the bottom of the page until you see the Advanced Actions sections in the sidebar on the right-hand side of the page.
Click the Enable Cloudflare on Site link.

Turning off Development Mode
Step 1
If you have previously turned on Cloudflare’s development mode, you can turn it off by logging in. Then, click your site that’s listed on the page.

Step 2
Next, go to the Caching tab.

Step 3
Scroll down to the Development Mode section and click the toggle button that’s currently set to “On.”

What to Do If All Else Fails
If you’re still seeing issues, contact Cloudflare support.
Provide them with the following details:
- Full URL(s) of the requested resource when the error occurred.
- Cloudflare’s Ray ID from the page where you saw the error 520 message.
- The output from http://your-site.com/cdn-cgi/trace, but be sure to replace “your-site.com” with your actual domain name.
- Two HAR files: One from when Cloudflare was enabled for your site and one more from when you had Cloudflare disabled.
Is #Cloudflare giving you the Error 520? Here’s how to troubleshoot it and get this issue fixed! 🌧️🌈Click to Tweet
Summary
The 520 error can seem confusing, especially since it’s a Cloudflare error. But, it has to do with an error with your server that causes Cloudflare to not connect.
The steps above are the solutions to the most common causes of error 520. If you’re still having issues after trying them, you might want to contact Cloudflare or your hosting support.
Suggested reading: How to Set up Cloudflare APO for WordPress.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275+ PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
When your site’s visitors see error 520 in their browser, it means Cloudflare is sending the message because your server returned an empty, unknown, or unexpected response.
The 520 error can be approached through troubleshooting first to find the cause and then fixed following these steps.
Let’s jump right in:
Troubleshooting Error 520
Since the 520 error is coming up because of an issue on your server, you can troubleshoot the issue by looking in your error log.

Disable Cloudflare
Before you start troubleshooting, it’s necessary to disable Cloudflare. This helps isolate the problem by ensuring the issue can be replicated without Cloudflare being a factor.
Step 1
Start by logging into Cloudflare. Then, find your site on the list and click on it.

Step 2
Next, click on the DNS tab, then on the orange cloud under the Proxy status section in the table. You’ll know Cloudflare was disabled because the cloud will have turned gray.

Pause Cloudflare
Alternatively, you can choose to pause Cloudflare after logging in.
Step 1
Click on your connected site from the list.

Step 2
Then, scroll down until you see the Advanced Actions section in the sidebar. Click on the Pause Cloudflare on Site link.

Step 3
A pop-up will be displayed on the page that asks you to confirm you want to pause Cloudflare. Go ahead and click the Confirm button.

Go into Development Mode
If you don’t want to pause or disable Cloudflare, you can keep it running, but place it in development mode so you can still troubleshoot error 520.
Step 1
After logging into Cloudflare, click the Caching tab toward the top of the page.

Step2
Next, scroll down to the Development Mode section and click the Off toggle button. It should now say “On.”

Checking Your Server’s Error Logs
Now that you have disabled, paused or put Cloudflare into development mode, you can troubleshoot error 520 by checking your server’s error logs.
Finding your error log can vary between hosts so check with yours if you’re unsure of where to find your error logs.
If your hosting provider uses cPanel, you can follow the steps below.
Step 1
Log into cPanel and in the dashboard, go to the Metrics section. Then, click the Errors button.

Step 2
The error log page displays errors in reverse chronological order as well as up to 300 of the most recent messages. The error log may display more messages if you or your host adjusted the settings.

Checking Your Log for Error 520 Using MyKinsta
If you host your WordPress site with Kinsta, you can follow the steps below to check your error log.
Step 1
Log into MyKinsta and click on Sites in the menu on the left. Then, select the site you want to troubleshoot from the list on the page.

Step 2
Click on the Logs tab. By default, the error log is displayed. If you don’t see anything listed, it’s due to the fact that no errors on your site have occurred.

How to Interpret the Error Log
Each message in an error log has a structure. If you understand it, you can interpret the error messages that come up.
[Fri Oct 11 17:00:30 2019] [error] [client 123.4.56.7] error description: /path/to/file/with/error
The date and time of the message are listed first followed by the LogLevel directive which tells you about the severity level of the message.
Next up is the IP address of the client. This is who made the issue appear.
Finally, the actual message is displayed and may contain a path to the affected file.
Here are the LogLevel severity levels which could be listed in your error log’s messages:
- Emerg – This lets you know the issue is an emergency and the server is unavailable.
- Alert – Action should be taken immediately if you see this level.
- Crit – This denotes a critical condition.
- Error – This means an error has occurred.
- Warn – A message with this level is a warning about an issue that requires your attention, but isn’t critical.
- Notice – This means your server is normal, but there are significant details about the condition of your server that is available.
- Info – General information is available with this level.
- Debug – These messages contain details when you have debugging enabled.
Use a cURL Command to Troubleshoot Error 520
You can also use a cURL command to troubleshoot error 520 by testing against the origin server.
curl -vso /dev/null --user-agent "Mozilla 5.0" -H "Host: your-site.com" http://123.45.6.789/wp-login.php
Be sure to change “you-site.com” to your actual domain. You also need to update “123.45.6.789” with your site’s IP address. If you changed your login page, you should also change the “wp-login.php” part.
A successful response header would look similar to the example below:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Day, DD, Month Year Hour:Minute:Second Timezone
{ [12345 bytes data]
* Connection #0 to host 123.45.6.789 left intact
If you see something like this, it means everything’s okay and the site was reached without an error 520 response.
On the other hand, if you see a response header similar to the example below, it means the 520 error has occurred when Cloudflare was active:
* Hostname was NOT found in DNS cache
* Trying 123.45.6.789...
* Connected to 123.45.6.789 (123.45.6.789) port 80 (#0)
> GET /login HTTP/1.1
> User-Agent: Mozilla 5.0
> Accept: */*
> Host: your-site.com
>
* Empty reply from server
* Connection #0 to host 123.45.6.789 left intact
How to Generate a HAR File
A HAR is an HTTP archive file. It contains archives for requests that are going to the server of origin and also through Cloudflare.
It can help you with troubleshooting because it compares response headers coming from the origin server and Cloudflare when it’s used as a proxy.
It’s also used to confirm that the headers are too large if that’s why error 520 has appeared.
You can create a HAR file with your browser with the steps below:
Chrome
Step 1
Open your browser and right-click on the page. Then, select Inspect.

Step 2
Once the panel has opened, click the Network tab and make sure there’s a red circle button toward the top, left-hand side of the panel. If it’s gray, click it.

Step 3
Check the Preserve log option next to the record button and then click the clear button.

Step 4
Load the page that’s bringing up error 520. Then, right-click anywhere in the messages area of the Chrome developer tool.
Select the Save as HAR with Content and save the file to your computer.

Firefox
Step 1
Open Firefox and right-click anywhere on the page. Then, select Inspect Element.

Step 2
Go to the Network tab and visit the page that has the 520 error coming up. Right-click on messages in the panel and select the Save All as HAR option.
Save the file to your computer.

Edge
Step 1
Open the Edge browser and right-click the page. Select Inspect from the list.

Step 2
Go to the Network tab and ensure the circular record button is red. If it’s not, click it. Check the Preserve log option, then the icon to clear the current messages.

Step 3
Go to the page where you’re experiencing error 520. Then, right-click on the messages in the developer tool panel and select the Save all as HAR with content option.
Save the file to your computer.
Safari
Step 1
Open Safari and right-click on the page for Windows or press CMD on your keyboard and click for Mac. Select Inspect Element from the list.

Step 2
Go to the Network tab. Check the Preserve Log option, then go to the page with the error 520 issue.

Step 3
Click the Export button and save the HAR file to your computer.

Resolving the Common Reasons for Error 520
Now that you have your error log, search through it and see if you notice any one of the issues below. Then, follow the steps below to resolve the issue.
Origin Server PHP Application Crashed
One common issue that causes error 520 is that one of the PHP applications have crashed on your server. Restarting PHP will fix the error.
Step 1
Using SSH, you can enter the command below for Apache servers:
apache2ctl restart
For Nginx servers, you can restart PHP using the command below:
service nginx restart
Restart PHP in MyKinsta
If your site is hosted with Kinsta, you can restart PHP in a few clicks.
Step 1
Log into MyKinsta and click on Sites on the left. Then, click on your site from the list.

Step 2
Go to the Tools tab and click the Restart PHP button.

Cloudflare IP Addresses Aren’t Whitelisted
Another reason why the 520 error can occur is if Cloudflare’s IP addresses aren’t whitelisted. You can whitelist them, but the steps vary between hosting providers.
If you’re not sure how to whitelist IPs, contact your host, especially if you don’t find any settings for it.
At Kinsta, Cloudflare’s IP addresses are whitelisted by default so there’s no need to worry about this cause of the error. It also won’t impact the other reasons why the error occurs.
TCP Idle Timeouts Are Shorter Than 300 Seconds
The Transmission Control Protocol (TCP) could also be the cause of error 520.
TCP is a standard protocol that establishes and maintains a network connection. If the TCP is set to timeout in under 300 seconds, it could cause the 520 error to pop up.
You can change the TCP service timeout using a CLI command:
set service Service-HTTP-1 -svrTimeout 500
Headers Exceed 8 KB
This issue is typically due to too many cookies or cookies that are too large. The HAR file that you downloaded during the troubleshooting process will show you if this is the problem.
Cloudflare has a limit of 8 KB that can be used for headers.
If you authored a plugin that requires too many cookies or has too much data in its cookies, try to reduce them. Or, if you’re using a lot of plugins that all need cookies, remove some of them (you should always use quality plugins).
Elementor Users
When you try to edit your WordPress site using Elementor and you get the 520 error – “Web server is returning an unknown error” – you can check the following.
First, you can try a different web browser.
If the problem still exists and your site is behind Cloudflare you may have a problem with Cloudflare’s Rocket Loader feature.
The issue was caused by Rocket Loader automatically changing the scripts to load asynchronously, which breaks the site editor and prevents you making changes.
By creating rules in Cloudflare you can solve this issue.
For Elementor pages: Site URL/*elementor*
For Elementor templates: Site URL/?elementor_library=*
Empty Response from Your Server
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are set correctly for your site’s domain.
The steps involved to check your settings depends on your DNS host. If your hosting plan has DNS bundled with it, then check with your hosting provider.
It may be important to note that if you updated your DNS settings, it may take up to 72 hours for your site to propagate. This means your site may be unavailable for up to three days.
After changing your DNS settings, you need to clear your site’s cache. If you have a caching plugin installed on your WordPress site, you can check its documentation if you’re unsure of how to clear your site’s cache from the plugin’s settings.
You can also clear your site’s cache through your hosting provider. Be sure to check with them if you need to know how to do this for your site.
If your site is hosted with Kinsta, you can click Sites in the menu, then on your listed site.
Then, click the Tools tab and click the Clear cache button.

If you have updated your DNS settings, your site is available again, you cleared your site’s cache and you still are experiencing error 520, restart your server.
If you don’t find the option in your settings, contact Kinsta’s support team and we’ll help you with this.
Missing Response Headers
According to Mozilla,
“A response header is an HTTP header that can be used in an HTTP response and that doesn’t relate to the content of the message. Response headers, like Age, Location or Server are used to give a more detailed context of the response.”
Missing response headers can be caused by a multitude of reasons.
Your best bet with this issue is to use a debugging tool like Fiddler to debug the issue and see exactly what the problem is so you can fix it.
Server not Returning Proper HTTP Error Responses
When your server sent an invalid error response, it could have caused the 520 error. This means the message didn’t fit in with the standard list of HTTP response codes.
It’s caused by your server or it could also be something on your server such as PHP applications or possibly plugins used on your WordPress site.
If you can’t find the source for the improper error code to fix it, try contacting support for further help.
Enabling Cloudflare Again
Check to see if you receive the error again. If you do, keep Cloudflare disabled and continue troubleshooting.
If the 520 error has been resolved, enable Cloudflare again.
Step 1
To do this, log into Cloudflare and if you disabled Cloudflare by turning the cloud gray in your account, start by selecting your site from the list.

Step 2
Click the DNS tab, then click the gray cloud to re-enable Cloudflare.

Restoring Cloudflare After Pausing It
Step 1
If you paused Cloudflare earlier, restore it by logging into Cloudflare and click on your listed site in the dashboard.

Step 2
Then, go to the Overview tab and scroll down to the bottom of the page until you see the Advanced Actions sections in the sidebar on the right-hand side of the page.
Click the Enable Cloudflare on Site link.

Turning off Development Mode
Step 1
If you have previously turned on Cloudflare’s development mode, you can turn it off by logging in. Then, click your site that’s listed on the page.

Step 2
Next, go to the Caching tab.

Step 3
Scroll down to the Development Mode section and click the toggle button that’s currently set to “On.”

What to Do If All Else Fails
If you’re still seeing issues, contact Cloudflare support.
Provide them with the following details:
- Full URL(s) of the requested resource when the error occurred.
- Cloudflare’s Ray ID from the page where you saw the error 520 message.
- The output from http://your-site.com/cdn-cgi/trace, but be sure to replace “your-site.com” with your actual domain name.
- Two HAR files: One from when Cloudflare was enabled for your site and one more from when you had Cloudflare disabled.
Is #Cloudflare giving you the Error 520? Here’s how to troubleshoot it and get this issue fixed! 🌧️🌈Click to Tweet
Summary
The 520 error can seem confusing, especially since it’s a Cloudflare error. But, it has to do with an error with your server that causes Cloudflare to not connect.
The steps above are the solutions to the most common causes of error 520. If you’re still having issues after trying them, you might want to contact Cloudflare or your hosting support.
Suggested reading: How to Set up Cloudflare APO for WordPress.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275+ PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
Ошибки 520, 521, 522, 524 могут появляться на сайте в том случае, если вы используете для своего сайта сервисы Cloudflare. Cloudflare — сервис, перенаправляющий трафик. Он позволяет увеличить скорость загрузки сайта и обеспечивает защиту от хакерских и DDoS-атак.
Ошибка 520 (Web server is returning an unknown error)
Если Cloudflare не удается обработать ответ сервера, на котором размещен сайт, то он выдает эту ошибку.
Причины появления ошибки 520
- Разрыв соединения, когда запрос к серверу был успешным.
- Превышение размера заголовка запроса (больше 8 КБ).
- Ответ сервера не содержит информацию.
- Ответ сервера некорректен.
Способы устранения ошибки 520 Web server is returning an unknown error
Если любое из вышеперечисленных условий исходит от веб-сервера, на котором размещен сайт, нужно обратиться в техподдержку хостинг-провайдера.
Правила ограничения скорости Cloudflare или другие запросы фильтрации иногда могут вызывать проблемы в работе сайта. Важно проверить и протестировать ваш сайт после подключения сервисов Cloudflare. Если на сервере хостинга используются системы безопасности, блокирующие запросы к сайту, обязательно укажите IP-адреса Cloudflare в белом списке, чтобы исключить вероятность блокировки запросов.
Список диапазонов IP-адресов Cloudflare
Ошибка 521 (Web Server Is Down)
Браузер показывает ошибку 521, когда веб-сервер неожиданно обрывает соединение с Cloudflare.
Причины появления ошибки 521
- Невозможно получить ответ от сервера.
- Система безопасности веб-сервера внесла запросы Cloudflare в черный список. Это связано с тем, что система работает по принципу обратного прокси-сервера. Ваша система безопасности могла принять периодические подключения от статических IP-адресов за DDoS-атаку. Из-за этого адреса блокируются или ограничиваются по скорости.
Способы устранения ошибки 521 Web Server Is Down
Возможно, веб-сервер отключен или работает с перебоями. В таком случае:
- Убедитесь, что ваш веб-сервер работает нормально.
- Просмотрите журналы ошибок сервера, чтобы выявить причину ошибки.
Если веб-сервер или хостинг-провайдер блокируют запросы Cloudflare, внесите в белый список все диапазоны IP-адресов сервиса в брандмауэре сервера или другом программном обеспечении безопасности.
Ошибка 522 (Connection timed out)
Появляется в случае, когда превышено время ожидания ответа от веб-сервера.
Причины появления ошибки 522
- Веб-сервер не может ответить на запрос из-за высокой загруженности.
- Система защиты веб-сервера блокирует запросы Cloudflare.
- Нет доступа к веб-серверу.
-
Некорректно указаны настройки DNS на Cloudflare: запросы отправляются по другому адресу.
-
Неверная настройка маршрутизации между Cloudflare и веб-сервером.
Способы устранения ошибки 522 Connection timed out
Убедитесь, что:
- IP-адреса Cloudflare не блокируются в брандмауэре.
- Ваш хостинг-провайдер не ограничивает скорость и не блокирует запросы от Cloudflare.
- Веб-сервер не перегружен.
Неисправную маршрутизацию в сети между Cloudflare и исходным веб-сервером устранить сложнее. Прежде чем перейти к этому пункту, исключите предыдущие. Если вы считаете, что причиной могут быть проблемы с сетью, отправьте заявку в службу поддержки Cloudflare.
Ошибка 524 (A timeout occurred)
Браузер покажет эту страницу, когда подключение к веб-серверу будет установлено, но его ответ превысит лимит ожидания. Cloudflare ожидает HTTP-ответ в течение 100 секунд.
Причины появления ошибки 524
- Проблемы в работе PHP-скриптов или сбой базы данных.
- Высокая загруженность веб-сервера.
Способы устранения ошибки 524 A timeout occurred
Проверьте доступные ресурсы веб-сервера, включая процессор, оперативную память и общий уровень трафика. Высокий уровень использования памяти память или высокая загрузка процессора могут сигнализировать о проблеме с ресурсами.
Если вы регулярно отправляете HTTP-запросы, выполнение которых занимает более 100 секунд (например, экспорт больших данных), рассмотрите возможность перемещения этих длительных процессов в поддомен, который не проксируется Cloudflare.
Служба поддержки RU-CENTER не оказывает техническую поддержку по сервису Cloudflare. Для устранения ошибок, пожалуйста, обратитесь в техническую поддержку Cloudflare. Если неполадки в работе сайта связаны с хостингом RU-CENTER, пожалуйста, отправьте заявку в нашу службу технической поддержки.
Туториал: как исправить ошибки сервера
Содержание
- На сайте ошибки 520, 521, 522, 524
- Unknown Error — ошибка 520
- Web Server Is Down — ошибка 521
- Connection timed out — ошибка 522
- A timeout occurred — Ошибка 524
- Ошибка Internal Server Error: что это и как с ней бороться
- Ошибка Internal Server Error: что это?
- Причины возникновения ошибки
- Ошибка Internal Server Error: как исправить простейшими способами
- Проблемы с движком WordPress
- Заключение
- Что такое ошибка 500 и когда она возникает
- Где и когда можно встретить ошибку 500
- Причины возникновения ошибки
- Год хостинга в подарок при заказе лицензии 1С-Битрикс
- Как получить больше данных о причине ошибки
- Как открыть панель разработчика
- Как устранить ошибку
- Ошибки в файле .htaccess
- Ошибки в скриптах сайта
- Скрипт не запускается
- Не хватает оперативной памяти
- Ошибки в CMS
На сайте ошибки 520, 521, 522, 524
520, 521, 522, 524 — это нестандартные типы ошибок, которые можно встретить при использовании сервиса CloudFlare. CloudFlare — сервис, с помощью которого можно перенаправить трафик на сайт, ускорить загрузку его страниц и настроить дополнительную защиту от DDoS-атак. Cloudflare работает как обратный прокси-сервер для сайта.
Unknown Error — ошибка 520
Если CloudFlare не может обработать ответ от веб-сервера, на котором расположен сайт, вы увидите ошибку 520:

Возможные причины ошибки:
- сервер дает некорректный ответ;
- приходит пустой ответ от сервера;
- сервер разорвал соединение после успешного запроса;
- заголовок запроса превышает ограничение размера (более 8 КБ).
Исправить ошибку 520 можно с помощью инструкций в справке CloudFlare.
Web Server Is Down — ошибка 521
Если между веб-сервером и CloudFlare оборвалось соединение, вы увидите ошибку 521:

Основные причины ошибки:
- сервер недоступен или не отвечает — проверьте работоспособность сервера;
- веб-сервер блокирует все запросы. Поскольку CloudFlare работает по принципу обратного прокси-сервера, все запросы приходят от IP-адресов системы. Система безопасности принимает регулярные подключения с одинаковых адресов IP за DDoS-атаку. Из-за этого накладываются ограничения по скорости.
На официальном сайте можно увидеть диапазон IP-адресов CloudFlare. Ошибку 521 можно исправить с помощью инструкций в справке CloudFlare.
Connection timed out — ошибка 522
Если время ожидания ответа от веб-сервера превышено, вы увидите ошибку 522:

Ошибка может возникнуть, если:
- веб-сервер недоступен;
- веб-сервер перегружен и не отвечает;
- запросы от CloudFlare блокирует система защиты веб-сервера;
- некорректные настройки маршрутизации между веб-сервером и CloudFlare;
- в настройках DNS на CloudFlare установлен некорректный IP-адрес.
Перед решением проблемы убедитесь, что ваш веб-сервер принимает HTTP-запросы. Также проверьте, что DNS в Личном кабинете на CloudFlare настроены корректно. Ошибку 522 можно исправить с помощью инструкций в справке CloudFlare.
A timeout occurred — Ошибка 524
В случае когда подключение с веб-сервером установлено, но он не успел ответить за установленное время ожидания, может возникнуть ошибка 524. Время ожидания HTTP-ответа на CloudFlare — 100 секунд.

Основные причины ошибки:
- перегружен веб-сервер (проверьте процессор, оперативную память и другие ресурсы сервера);
- задержка запроса к базам данных или PHP-процесса.
Ошибку 522 можно исправить с помощью инструкций в справке CloudFlare.
Обратите внимание!
Специалисты 2domains не оказывают техническую поддержку по сервису CloudFlare. По вопросам возникновения ошибок обращайтесь в техническую поддержку CloudFlare. Если некорректная работа сайта связана с хостингом 2domains, оставьте заявку в клиентскую службу.
Источник
Ошибка Internal Server Error: что это и как с ней бороться
Достаточно часто владельцы хостингов мучаются из-за постоянного возникновения сообщения об ошибке 500 (Internal Server Error). Она, как это называется, многим попросту отравляет жизнь. Сейчас мы попробуем кратко разобраться в сути самой ситуации и посмотрим, как же можно избавиться от появления ошибки в будущем.
Ошибка Internal Server Error: что это?
Итак, начнем, пожалуй, с самого значения этого словосочетания. В системе (каталоге) ошибок Windows (и не только) есть ошибка под номером 500, отвечающая компьютерному термину Internal Server Error. Перевод этого словосочетания означает внутреннюю ошибку сервера, связанную со статусом протокола HTTP.

По сути, ошибка означает, что программное обеспечение сервера либо не работает, либо работает, но один или несколько его компонентов дают сбои в виде отказа на клиентские запросы, например, поисковой системы или интернет-браузера.
Причины возникновения ошибки
Говоря об ошибке Internal Server Error в самом широком понимании, стоит учитывать, что возникать она может на множестве сайтов или ресурсов, написанных с помощью совершенно разных CMS. Тут, кстати, нужно разграничить причины ее возникновения.
Очень часто такая ситуация может наблюдаться на сайтах типа WordPress, OpenCart, Joomla и др. Если же структуры управления, подобные WordPress, при построении сайта не используются, возможно, причина кроется в том, что на самом хостинге возникают сбои при подключении неправильных PHP-расширений, или сайт после запроса возвращает некорректные HTTP-заголовки, которые не могут быть распознаны вашим сервером.

Не менее распространенной причиной возникновения ошибки Internal Server Error можно назвать отсутствие корректных прав доступа. Так, например, если на PHP файлы скриптов, которые размещены на хостинге, имеют права доступа 777, очень может быть, что их исполнение попросту блокируется сервером, вследствие чего и выдается сообщение об ошибке.
Также одной из причин может быть достаточно долгая работа скриптов. Дело в том, что PHP-ограничения по времени исполнения действуют не только в отношении хостинга, подобные лимиты могут выставляться и со стороны сервера. Иными словами, это несколько напоминает тайм-аут операции. Когда сервер в течение определенного времени не получает ответа на запрос, он попросту блокирует исполнение скрипта.
В некоторых случаях ошибка Internal Server Error может появляться, когда на хостинге наблюдается превышение лимита используемой памяти. Попросту говоря, скрипт для исполнения требует больше положенного, а ведь такой лимит устанавливается не только на PHP, зачастую действуют ограничения по потреблению ресурсов всеми исполняемыми скриптами.

Наконец, одна из самых распространенных ситуаций возникновения ошибки Internal Server Error – это содержание некорректных директив в файле .htaccess (кстати, при работе с движком WordPress это проявляется наиболее часто). Вот теперь мы вплотную подошли к поиску решения для каждой конкретной ситуации.
Ошибка Internal Server Error: как исправить простейшими способами
Для начала посмотрим, что можно сделать при обнаружении неправильных прав доступа. В данном случае права доступа 777 позволяют редактировать содержимое абсолютно всем, что, несомненно, сказывается на безопасности. В такой ситуации необходимо их изменить, применив к папкам значение 755, к файлам скриптов – 600, а ко всем стальным файлам данных – 644.

При слишком долгой работе исполняемого скрипта можно попробовать увеличить время ожидания, правда, тут есть одна загвоздка. Такое решение может сработать на выделенном сервере или VPS (Virtual Private Server), а в случае виртуального хостинга никакого эффекта не будет.
Что касается завышенного потребления памяти в сравнении с ограничениями, действующими на хостинге, тут можно посоветовать только обратиться в службу поддержки или же попросту сменить самого хостинг-провайдера, у которого ограничения будут не такими жесткими.
Теперь несколько слов о файле .htaccess. Дело в том, что он предполагает использование очень строгого синтаксиса, если при проведении настроек были допущены ошибки или некоторые неточности, избежать появления ошибки Internal Server Error не удастся. Тут нужно поступить следующим образом. Для начала нужно проверить наличие самого файла в корневой директории сайта, после чего, сделав его резервную копию, удалить целиком и полностью. Если после такой процедуры сайт снова станет работоспособным, значит проблема именно в файле .htaccess, который придется проверить на наличие ошибок в синтаксисе.
Проблемы с движком WordPress
С WordPress дело обстоит хуже. Дело в том, что этот движок способен перезаписывать оригинальный файл .htaccess, отвечающий за управление доступом к файлам и папкам хостинга, а ведь оригинальный файл должен создаваться всего один раз, и тем более не в WordPress!

Самым простым способом исправления такой ситуации является отключение темы WordPress и использование вместо нее любой другой. Если ошибка исчезла, дело именно в самой теме, если нет – нужно поэтапно отключать плагины WordPress и проверять, какой из них влияет на работоспособность.
В некоторых случаях может потребоваться обновить WordPress до последней версии и отключить функцию перезаписи файла. Для начала скачиваем на компьютерный терминал оригинальный файл .htaccess, затем входим на сайте в папку по пути /wp-admin/includes/ с последующей загрузкой файла misc.php, который необходимо открыть, скажем, в стандартном «Блокноте» (или любом другом текстовом редакторе) и найти строку функции «function save_mod_rewrite_rules». Теперь в самой функции переходим к строке «return insert_with_markers( $htaccess_file, ‘WordPress’, $rules );» и заменяем ее на «return true;» (естественно, все команды прописываются без кавычек). Остается только сохранить изменения и загрузить новый файл на хостинг с заменой старого файла misc.php.
Недостатком такого метода является только то, что в данном случае отключается обновление WordPress. При подключении плагинов они работать, естественно, не будут.
Заключение
В принципе, это, так сказать, наиболее распространенные причины появления ошибки и методы ее устранения. На самом деле, что причин, что способов борьбы с такими ситуациями может быть очень много, так что, придется анализировать ситуацию в каждом конкретном случае, а только потом выбирать, какую именно методику для исправления ошибки использовать.
Источник
Что такое ошибка 500 и когда она возникает

Пользователи интернета и владельцы сайтов периодически сталкиваются с различными ошибками на веб-страницах. Одной из самых распространенных ошибок является error 500 (ошибка 500). Поговорим в нашей статье о том, что это за ошибка и как ее исправить.
Где и когда можно встретить ошибку 500
Вы можете увидеть ошибку на любом веб-ресурсе, браузере и устройстве. Она не связана с отсутствием интернет-соединения, устаревшей версией операционной системы или браузера. Кроме того, эта ошибка не указывает на то, что сайта не существует или он больше не работает.
Отображаться ошибка может по-разному. Вот пример:

Если ошибка появилась на вашем сайте, то нужно скорее ее исправлять. Далее я расскажу, как это можно сделать.
Причины возникновения ошибки
Итак, ошибка 500 возникает, когда серверу не удается обработать запрос к сайту. Из-за этого пользователи не могут попасть на сайт, а поисковые системы полноценно с ним работать. Очевидно, что ошибка нуждается в исправлении. В первую очередь необходимо найти проблему.
Основной причиной ошибки 500 может быть:
- Неверный синтаксис файла .htaccess. htaccess – это файл, в котором можно задавать настройки для работы с веб-сервером Apache и вносить изменения в работу сайта (управлять различными перенаправлениями, правами доступа к файлам, опциями PHP, задавать собственные страницы ошибок и т.д.).
Узнать больше о файле .htaccess можно в статье «Создание и настройка .htaccess». - Ошибки в скриптах сайта, то есть сценариях, созданных для автоматического выполнения задач или для расширения функционала сайта.
- Нехватка оперативной памяти при выполнении скрипта.
- Ошибки в коде CMS, системы управления содержимым сайта. В 80% случаев виноваты конфликтующие плагины.
Год хостинга в подарок при заказе лицензии 1С-Битрикс
Выбирайте надежную CMS с регулярными обновлениями системы и профессиональной поддержкой.
Как получить больше данных о причине ошибки
Что означает ошибка 500, мы теперь знаем. Когда она перестала быть таким загадочным персонажем, не страшно копнуть глубже — научиться определять причину ошибки. В некоторых случаях это можно сделать самостоятельно, так что обращаться за помощью к профильному специалисту не понадобится.
Самые частые причины ошибки 500 можно распознать по тексту ошибки или внешнему виду страницы.
- Сообщение Internal Server Error говорит о том, что есть проблемы с файлом .htaccess (например, виновата некорректная настройка файла). Убедиться, что .htaccess является корнем проблемы, поможет следующий прием: переименуйте файл .htaccess, добавив единицу в конце названия. Это можно сделать с помощью FTP-клиента (например, FileZilla) или файлового менеджера на вашем хостинге (в Timeweb такой есть, с ним довольно удобно работать). После изменения проверьте доступность сайта. Если ошибка больше не наблюдается, вы нашли причину.
- Сообщение HTTP ERROR 500 или пустая страница говорит о проблемах со скриптами сайта. В случае с пустой страницей стоит учесть, что отсутствие содержимого сайта не всегда указывает на внутреннюю ошибку сервера 500.
Давайте узнаем, что скрывается за пустой страницей, обратившись к инструментам разработчика. Эта браузерная панель позволяет получить информацию об ошибках и другие данные (время загрузки страницы, html-элементы и т.д.).
Как открыть панель разработчика
- Нажмите клавишу F12 (способ актуален для большинства браузеров на Windows). Используйте сочетание клавиш Cmd+Opt+J, если используете Google Chrome на macOS. Или примените комбинацию Cmd+Opt+C в случае Safari на macOS (но перед этим включите «Меню разработки» в разделе «Настройки» -> «Продвинутые»). Открыть инструменты разработчика также можно, если кликнуть правой кнопкой мыши в любом месте веб-страницы и выбрать «Просмотреть код» в контекстном меню.
- Откройте вкладку «Сеть» (или «Network») и взгляните на число в поле «Статус». Код ответа об ошибке 500 — это соответствующая цифра.
Более детальную диагностику можно провести с помощью логов.
Как вы видите, данных в логи записывается немало, поэтому они разделены по типам. За сведениями о нашей ошибке можно обратиться к логам ошибок (error_log). Обычно такие логи предоставляет служба поддержки хостинга, на котором размещен сайт. В Timeweb вы можете включить ведение логов и заказать необходимые данные в панели управления. Разобраться в полученных логах поможет статья «Чтение логов».
Как устранить ошибку
Теперь поговорим о том, как исправить ошибку 500. Вернемся к популярным причинам этой проблемы и рассмотрим наиболее эффективные способы решения.
Ошибки в файле .htaccess
У этого файла довольно строгий синтаксис, поэтому неверно написанные директивы (команды) могут привести к ошибке. Попробуйте поочередно удалить команды, добавленные последними, и проверьте работу сайта.
Также найти проблемную директиву можно с помощью логов ошибок (через те же инструменты разработчика в браузере). На ошибку в директиве обычно указывает фраза «Invalid command». Информацию о верном написании директивы или способе исправления ошибок в .htaccess вы можете найти в интернете. Не нужно искать, почему сервер выдает ошибку 500, просто введите в строку поиска название нужной команды или текст ошибки из логов.
Ошибки в скриптах сайта
Скрипт не запускается
Обычно это происходит, когда существует ошибка в скрипте или функция, которая не выполняется. Для успешного запуска скрипта функция должна быть верно прописана, поддерживаться сервером и выполняться от используемой версии PHP. Бывают ситуации, когда функция несовместима с определенными версиями PHP. Получить более подробную информацию о той или иной функции можно в интернете.
Не хватает оперативной памяти
Если в логах вы видите ошибку «Allowed memory size», для устранения ошибки 500 стоит оптимизировать работу скрипта. Вы можете воспользоваться специальными расширениями для анализа производительности скрипта или обратиться за помощью к специалисту, который поработает над его оптимизацией.
Если ваш сайт размещен на отдельном физическом или виртуальном сервере, можно попробовать увеличить максимальное использование оперативной памяти на процесс (memory_limit). На шаред хостинге этот параметр обычно не изменяется, но есть возможность купить хостинг помощнее.
Ошибки в CMS
Если код CMS содержит неверный синтаксис, это может вывести сайт из строя. В таком случае логи сообщат вам об ошибке 500 текстом «PHP Parse error: syntax error, unexpected». Так происходит, когда некорректно работает плагин (или тема, используемая в CMS, но реже) либо есть ошибки в коде. Ошибка может быть допущена случайно, произойти при обновлении плагина или версии CMS.
При чтении логов обратите внимание на путь, который следует за сообщением об ошибке, ведь он может указать на проблемную часть кода или плагин. Если проблема в плагине, для восстановления работы сайта переименуйте на время папку, в которой он расположен. Попробуйте обновить плагин или откатить его до прежней версии. Если ситуацию не удается исправить, от расширения стоит отказаться либо заменить его аналогом.
Также в большинстве случаев подобные проблемы помогает решить поддержка CMS.
Информацию о других распространенных ошибках вы можете найти в статье «6 наиболее часто возникающих ошибок HTTP и способы их устранения».
Источник
BNAME.RU » Код ошибки HTTP 520 Unknown Error Cloudflare
Ошибка 520: веб-сервер возвращает неизвестную ошибку
Ошибка 520 возникает, когда исходный сервер возвращает пустой, неизвестный или неожиданный ответ Cloudflare.
Как устранить ошибку 520 Unknown Error?
Быстрый обходной путь при дальнейшем исследовании ошибок 520 — либо помутить DNS-запись в приложении Cloudflare DNS серым цветом, либо временно приостановить Cloudflare.
Обратитесь к своему хостинг-провайдеру или администратору сайта и запросите проверку журналов ошибок исходного веб-сервера на предмет сбоев и проверки следующих распространенных причин:
- Сбой приложения веб-сервера Origin
- IP-адреса Cloudflare не разрешены в вашем источнике
- Заголовки размером более 32 КБ (обычно из-за слишком большого количества файлов cookie)
- Пустой ответ от исходного веб-сервера без кода состояния HTTP или тела ответа.
- Отсутствуют заголовки ответа или исходный веб-сервер не возвращает правильные ответы об ошибках HTTP
Ошибки 520 распространены в некоторых приложениях PHP, которые приводят к сбою исходного веб-сервера.
Если после обращения к вашему хостинг-провайдеру или администратору сайта 520 ошибок продолжаются, предоставьте в службу поддержки Cloudflare следующую информацию:
- Полный URL-адрес ресурса, запрошенного при возникновении ошибки
- Cloudflare cf-ray из сообщения об ошибке 520
- Вывод из http://www.example.com/cdn-cgi/trace (замените www.example.com на свое имя хоста и домен, на котором произошла ошибка 520)
Два файла HAR:
- один с включенным Cloudflare на вашем сайте и
- другой с временно отключенным Cloudflare.


ЯПлакалъ! запись закреплена
В случае ошибки 520 на ЯПе с ХромCloudflare просьба почистить куки (ЯПЯП-ФайлыCF)
Друзья, мы заметили, что иногда в случае серфинга по ЯПу с ХромаWindows с новой защитой, иногда может возникать ошибка 520.
В этом случае для решения может помочь удалить в хроме:
— cookies ЯПа;
— cookies ЯП-Файлов;
— cookies CloudFlare (если есть)
Код ошибки HTTP 520 Unknown Error Cloudflare (Неизвестная ошибка) Cloudflare
Ошибка 520: веб-сервер возвращает неизвестную ошибку
Ошибка 520 возникает, когда исходный сервер возвращает пустой, неизвестный или неожиданный ответ Cloudflare.
Как устранить ошибку 520 Unknown Error?
- Сбой приложения веб-сервера Origin
- IP-адреса Cloudflare не разрешены в вашем источнике
- Заголовки размером более 32 КБ (обычно из-за слишком большого количества файлов cookie)
- Пустой ответ от исходного веб-сервера без кода состояния HTTP или тела ответа.
- Отсутствуют заголовки ответа или исходный веб-сервер не возвращает правильные ответы об ошибках HTTP
Если после обращения к вашему хостинг-провайдеру или администратору сайта 520 ошибок продолжаются, предоставьте в службу поддержки Cloudflare следующую информацию:
Ошибки 520, 521, 522, 524 на сайте
Ошибки 520, 521, 522, 524 связаны с проблемами в работе сервиса CloudFlare.
CloudFlare — сервис для перенаправления трафика на сайт с помощью облачного прокси-сервера, который обеспечивает дополнительную защиту от DDoS-атак и ускоряет загрузку вашего сайта.
Ошибка 520 Unknown Error
Что означает ошибка 520? Система CloudFlare выдаёт 520 ошибку, если не может обработать ответ от веб-сервера, на котором расположен сайт:

Причины появления ошибки:
- сброс соединения (после успешного запроса сервер разорвал соединение);
- заголовок запроса превышает ограничение размера заголовка Cloudflare (более 8 КБ). Если у вас много файлов cookie или они очень большие, это может привести к увеличению размера заголовков. Так как у Cloudflare есть ограничение на размер заголовка в 8 КБ, он не может обработать длинный заголовок;
- пустой ответ от сервера. Это происходит, когда DNS домена указывают на неправильный сервер.
- некорректный ответ от сервера;
- система безопасности блокирует запросы. Укажите IP-адреса Cloudflare в белом списке, чтобы система не блокировала запросы.
Способы устранения ошибки:
- Отключить CloudFlare. Так вы сможете понять, где находится ошибка (на сервере или в CloudFlare).
- Удалить плагины. Для плагинов иногда требуется много файлов cookies. Если на сайте много плагинов, это может повлиять на размер заголовков. Они могут быть слишком большими по размеру, и Cloudflare не справится с ними. Чтобы исправить ошибку, отключите плагины один за другим. Если ошибка пропадёт, удалите некоторые из плагинов.
- Проверьте настройки DNS в CloudFlare. Убедитесь, что запись A указывает на правильный IP-адрес.
Подробные рекомендации по исправлению ошибки 520 даны в справке CloudFlare.
Ошибка 521 Web Server Is Down
Код ошибки 521 возникает, когда веб-сервер обрывает соединение с CloudFlare:

Это может произойти в двух случаях:
сервер не отвечает или недоступен. Необходимо проверить работоспособность сервера;
веб-сервер блокирует запросы CloudFlare. Поскольку CloudFlare работает как обратный прокси-сервер, все запросы к серверам поступают от IP-адресов CloudFlare. Иногда система безопасности хостинга принимает постоянные подключения с одних и тех же IP-адресов за DDoS-атаку. В результате на IP-адреса CloudFlare накладывается блокировка/ограничения по скорости.
Диапазон IP-адресов CloudFlare вы можете увидеть по ссылке.
Рекомендации по исправлению ошибки 521 даны в справке CloudFlare.
Ошибка 522 Connection timed out
Ошибка 522 возникает, если превышено время ожидания ответа от веб-сервера и пользователь не может попасть на страницу:

Основные причины:
- веб-сервер перегружен и не ответил на запрос,
- на веб-сервере стоит система защиты, которая блокирует запросы от CloudFlare,
- веб-сервер недоступен,
- некорректный IP-адрес, установленный в настройках DNS на CloudFlare (Запрос от CloudFlare был отправлен на другой IP),
- проблемы с маршрутизацией сети между CloudFlare и веб-сервером.
Что делать? Для решения проблемы удостоверьтесь, что ваш веб-сервер активен и принимает HTTP-запросы. Проверьте, корректны ли настройки DNS в Личном кабинете на CloudFlare.
Подробные рекомендации по исправлению ошибки 522 даны в справке CloudFlare.
Как исправить ошибку 522 в Google Chrome
- Очистите кеш браузера. Браузер может быть переполнен данными о посещении сайтов. Освободите место в кэше браузера по инструкции.
- Удалите расширение браузера, которое нарушает соединение с сервером. Отключайте расширения по очереди, чтобы найти то, которое выдает ошибку.
- Проверьте подключение к интернету. Низкая скорость интернета или перебои при подключении может повлиять на время получения ответа сервера. Из-за этого и появляется ошибка 522.
Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:

Введите в командной строке:
Готово, вы получите сообщение с количеством переданных и полученных пакетов. Если потерянных пакетов нет, значит, у вас хорошее соединение с интернетом и проблема в другом. Если потерянные пакеты есть, свяжитесь с интернет-провайдером, чтобы улучшить интернет-соединение.

4. Очистите кеш DNS. Проблемы с соединением могут возникнуть из-за несоответствия IP-адреса сервера сайта в кэше компьютера с реальным адресом. Такое происходит, когда владельцы сайтов по какой-либо причине меняют IP-адреса сервера. Чтобы устранить эту проблему, воспользуйтесь инструкцией.
Ошибка 524 A timeout occurred
Ошибка 524 возникает, когда подключение с веб-сервером установлено, но он не ответил за установленное время ожидания соединения:

Время ожидания HTTP-ответа на CloudFlare — 100 секунд. Если веб-сервер не предоставил ответ, система выдаст 524 ошибку.
- длительная работа PHP-процесса или запроса к базе данных;
- веб-сервер перегружен. Проверьте доступные ресурсы сервера, в том числе процессор и оперативную память.
Если вы регулярно выполняете тяжёлые запросы, которые могут занять больше 100 секунд, переместите эти процессы на субдомен, который не проксимируется в Cloudflare.
Рекомендации по исправлению ошибки 524 даны в справке CloudFlare.
Ошибки 520-524 требуют много знаний о сервере и его работе, поэтому самый верный способ решить проблему ― обратиться к хостинг-провайдеру, администратору сайта или к технической поддержке CloudFlare (если проблема на стороне их сервиса).
522 ошибка: превышено время ожидания подключения
Аватар Мишель Zatlyn 28 мая 2015 05:22
Когда вы посещаете веб-сайт через cloudflare помогает, может появиться ошибка 522. Эта ошибка возникает от cloudflare не удалось подключиться к происхождению веб-сервер.

Вы-посетитель сайта?
Если вы посещаете веб-сайт и испытать это ошибка, пожалуйста, свяжитесь с владельцем сайта или вебмастером.
Вы владелец сайта?
В 522 ошибка, то возвращается ответ, когда от cloudflare не удалось установить TCP-соединение с веб-сайта сервера источника.
Эта проблема может возникнуть, если выполняется одно из следующих условий:
Ограничения скорости для входящих подключений в cloudflare ИПС.
Процесс на сервер потребляет все из одного или более ресурсов в начале координат.
Домен на хостинг-платформу, где трафик или задачи для отдельного домена на одном сервере занимая один или более ресурсов.
Проблемы с сетевым подключением между cloudflare и на исходном веб-сервере.
Хотя приведенные выше причины являются наиболее распространенными, они не единственные причины, по которым 522 может быть возвращен при попытке доступа к вашему домену.
Протокол TCP рукопожатие
Когда кто-то посещает от cloudflare сайт с поддержкой, устанавливается связь между cloudflare и сайта сервера источника. Для установления соединения TCP использует трехэтапное.
Син: от cloudflare три отправляет Syn-пакетов на исходном сервере.
С Syn+ACK пакет: в ответ, происхождение сервер отвечает с Syn+ACK пакет.
Подтверждение (ACK): наконец-то, от cloudflare посылает подтверждение обратно на исходный сервер.
В этот момент оба cloudflare и происхождение сервер получила признание соединение и связь устанавливается. Если исходный сервер не посылаете Syn+ACK пакет обратно к cloudflare в течение 15 секунд, 522 произойдет ошибка и соединение закрывается.
Вот схема, иллюстрирующая успешного квитирования TCP:
Вот пример, где с Syn+ACK пакет не возвращается от сервера источника в течение 15 секунд, вызывая 522 тайм-аут:
Еще одно условие для 522-аут происходит, когда происхождение реагирует с Syn+ACK и установлено TCP-соединение, но никогда не отвечает на запрос подтверждение (ACK) в течение 90 секунд (в 524 условии подтверждения запроса, но ожидание слишком долго для отправки ответа). Вот иллюстрация с подробным описанием этого сценария:
Проверка этих условий у администратора сервера или хостинг-провайдер является лучшим способом для устранения этих ошибок. Если есть проблемы с сетью, а трассировка или ССО с сайта Origin может быть полезно (описано ниже).
Если вы продолжаете видеть 522 ошибок после исключив вышеупомянутые возможности и устранить проблему, обратитесь в cloudflare поддержки для дальнейшего расследования.
Устранение неполадок
При устранении этих ошибок, это-обычно хорошая практика, чтобы подтвердить, что от cloudflare IPS и находятся в белом списке и не будучи ограничить или заблокировать веб-сервер среды (межсетевого экрана, балансировки нагрузки, нетто-скалер и др.), или в пределах узла сети (т. е. роутер уровне).
При отладке, один из самых полезных инструментов в этих случаях управлением ССО, которая является надежной сетевой диагностический инструмент, который помогает отлаживать и изолировать проблемы в сети, обеспечивая полезные отчеты о состоянии сети в маршрут к указанному месту назначения/узла.
ССО команды должны выполняться от сайта сервера источника, чтобы подтвердить, если проблема происходит в вышестоящий в пределах транзитного провайдера, интернет-провайдера или хоста в сети (между происхождения и cloudflare).
При запуске ССО от узла исходного сервера, трассировка должна выполняться одним из от cloudflare IPS Сенсорный (получить, выполнив поиск в DNS для домена — копать, команда nslookup, или 3-й партии инструмент поиска в DNS), назначенный для домена в cloudflare, когда включена на сайт:
ССО -рфос 30 104.16.30.27
Команда, представленная выше, запустить отчет и отправить 30 пакетов в каждом прыжке сетевой путь к ИС от cloudflare.
Вот пример ССО Выходные данные, показывающие значительные потери пакетов в сетевом пути к cloudflare края (показывая потери с вышестоящим провайдером и после этого тайм-ауты), которые с большой вероятностью приведет в 522 тайм-аут для веб-запросы через прокси сервера источника:
Ведущий: 10.0.0.44 потери% ЕНТ в прошлом avg лучших Wrst Стандотклон
10.0.0.1 0.0% 10 0.5 0.5 7.1 36.1 10.4
ldn-b5-link.telia.net 10.0% 10 0.3 0.3 0.2 0.3 0.0
ldn-bb2-link.telia.net 80.0% 10 0.3 0.3 2.7 20.3 6.3
ash-bb3-link.telia.net 50.0% 10 75.7 76.8 74.2 88.0 4.1
ash-bb4-link.telia.net 40.0% 10 74.2 74.2 80.6 103.4 9.9
ash-b1-link.telia.net 10.0% 10 94.0 88.9 81.9 94.7 6.4
??? 0.0% 10 0.0 0.0 0.0 0.0 0.0
??? 0.0% 10 0.0 0.0 0.0 0.0 0.0
??? 0.0% 10 0.0 0.0 0.0 0.0 0.0
??? 0.0% 10 0.0 0.0 0.0 0.0 0.0
В приведенном выше примере обратите внимание на процент потерь видел в сети хмеля 2-6, а потом раз уходит после этого в сетевом пути. Это сценарий, который, вероятно, представляет Тип потери пакетов, что может вызвать 522 тайм-ауты или другие, связанные с сетью проблемы возникают.
Пострадавших пользователей следует провести КДС следа от их локальной машине, чтобы подтвердить, где они подключаются к сети в пределах от cloudflare. Это можно сделать, зайдя в /КДС-чвг/след URL-адреса для сайта:
http://www.example.com/cdn-cgi/trace
*Примечание: заменить «www.example.com» с доменным именем возникли проблемы.
Помимо запущена и просьбой ССО/отслеживание, под управлением команды Curl (завиток-инструмент командной строки, который может быть использован для отправки запросов с использованием синтаксиса URL-адресов) может также использоваться для подтверждения происхождения реагирования и являются подходящими для получения более подробной информации о характере проблемы.
В этом примере, используя ‘время’ команда с завитка может быть полезным в определении типа тайм-аута, которые могут иметь место для запроса:
время локон -Шереметьево /дев/нуль http://example.com/
* Подключение() к example.com порт 80 (#0)
* Пытается 108.162.198.116…
* Подключены к example.com (108.162.198.116) порт 80 (#0)
> ПОЛУЧАТЬ / ОТПРАВЛЯТЬ HTTP/1.1
> Пользователь-Агент: локон/7.30.0
> Хост: example.com
> Примите: */*
>
< НТТР/1.1 522 происхождения времени ожидания подключения
* Сервер от cloudflare-nginx-это не черный список
< Сервер: от cloudflare-nginx в
< Дата: Пн, 02 фев 2015 22:16:15 МСК
< Содержимое-Тип: текст/HTML; Кодировка=Кодировка utf-8
< Кодирование передачи: поблочное
< Связь: держите-живой
< Настройка cookie: __cfduid=d0978ac2b152b4695895bd94ed249f9c21394385360738; истекает=Пн, 23-дек-2019 23:50:00 по Гринвичу; путь=/; domain=.example.com; HttpOnly
< Истекает: четверг, 01 январь 1970 00:00:01 ГМ
< Кэш-управления: нет-магазине, без кэша, обязательно перепроверить, после проверки=0, предварительно проверить=0
< Прагма: нет-кэш
< МВ-Рэй: 1088eaf894ce0701-ГАК
<
{ [данные не показано]
* Подключение #0 до хоста example.com оставил нетронутыми
реальный 0m15.905s
пользователь 0m0.507s
представление sys 0m0.009s
Последний раз редактировалось: Admin (Вс Янв 17, 2016 6:18 am), всего редактировалось 1 раз(а) (Обоснование : 522, ошибка, превышено, время, ожидания, подключения)
Ошибки 520, 521, 522, 524 связаны с проблемами в работе сервиса CloudFlare.
CloudFlare — сервис для перенаправления трафика на сайт с помощью облачного прокси-сервера, который обеспечивает дополнительную защиту от DDoS-атак и ускоряет загрузку вашего сайта.
Ошибка 520 Unknown Error
Что означает ошибка 520? Система CloudFlare выдаёт 520 ошибку, если не может обработать ответ от веб-сервера, на котором расположен сайт:
Причины появления ошибки:
- сброс соединения (после успешного запроса сервер разорвал соединение);
- заголовок запроса превышает ограничение размера заголовка Cloudflare (более 8 КБ). Если у вас много файлов cookie или они очень большие, это может привести к увеличению размера заголовков. Так как у Cloudflare есть ограничение на размер заголовка в 8 КБ, он не может обработать длинный заголовок;
- пустой ответ от сервера. Это происходит, когда DNS домена указывают на неправильный сервер.
- некорректный ответ от сервера;
- система безопасности блокирует запросы. Укажите IP-адреса Cloudflare в белом списке, чтобы система не блокировала запросы.
Способы устранения ошибки:
- Отключить CloudFlare. Так вы сможете понять, где находится ошибка (на сервере или в CloudFlare).
- Удалить плагины. Для плагинов иногда требуется много файлов cookies. Если на сайте много плагинов, это может повлиять на размер заголовков. Они могут быть слишком большими по размеру, и Cloudflare не справится с ними. Чтобы исправить ошибку, отключите плагины один за другим. Если ошибка пропадёт, удалите некоторые из плагинов.
- Проверьте настройки DNS в CloudFlare. Убедитесь, что запись A указывает на правильный IP-адрес.
Подробные рекомендации по исправлению ошибки 520 даны в справке CloudFlare.
Ошибка 521 Web Server Is Down
Код ошибки 521 возникает, когда веб-сервер обрывает соединение с CloudFlare:
Это может произойти в двух случаях:
- сервер не отвечает или недоступен. Необходимо проверить работоспособность сервера;
- веб-сервер блокирует запросы CloudFlare. Поскольку CloudFlare работает как обратный прокси-сервер, все запросы к серверам поступают от IP-адресов CloudFlare. Иногда система безопасности хостинга принимает постоянные подключения с одних и тех же IP-адресов за DDoS-атаку. В результате на IP-адреса CloudFlare накладывается блокировка/ограничения по скорости.
Диапазон IP-адресов CloudFlare вы можете увидеть по ссылке.
Рекомендации по исправлению ошибки 521 даны в справке CloudFlare.
Ошибка 522 Connection timed out
Ошибка 522 возникает, если превышено время ожидания ответа от веб-сервера и пользователь не может попасть на страницу:
Основные причины:
- веб-сервер перегружен и не ответил на запрос,
- на веб-сервере стоит система защиты, которая блокирует запросы от CloudFlare,
- веб-сервер недоступен,
- некорректный IP-адрес, установленный в настройках DNS на CloudFlare (Запрос от CloudFlare был отправлен на другой IP),
- проблемы с маршрутизацией сети между CloudFlare и веб-сервером.
Что делать? Для решения проблемы удостоверьтесь, что ваш веб-сервер активен и принимает HTTP-запросы. Проверьте, корректны ли настройки DNS в Личном кабинете на CloudFlare.
Подробные рекомендации по исправлению ошибки 522 даны в справке CloudFlare.
Как исправить ошибку 522 в Google Chrome
Методы решения:
- Очистите кеш браузера. Браузер может быть переполнен данными о посещении сайтов. Освободите место в кэше браузера по инструкции.
- Удалите расширение браузера, которое нарушает соединение с сервером. Отключайте расширения по очереди, чтобы найти то, которое выдает ошибку.
- Проверьте подключение к интернету. Низкая скорость интернета или перебои при подключении может повлиять на время получения ответа сервера. Из-за этого и появляется ошибка 522.
Как проверить подключение к интернету
- 1.
Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:
- 2.
Введите в командной строке:
Готово, вы получите сообщение с количеством переданных и полученных пакетов. Если потерянных пакетов нет, значит, у вас хорошее соединение с интернетом и проблема в другом. Если потерянные пакеты есть, свяжитесь с интернет-провайдером, чтобы улучшить интернет-соединение.
4. Очистите кеш DNS. Проблемы с соединением могут возникнуть из-за несоответствия IP-адреса сервера сайта в кэше компьютера с реальным адресом. Такое происходит, когда владельцы сайтов по какой-либо причине меняют IP-адреса сервера. Чтобы устранить эту проблему, воспользуйтесь инструкцией.
Ошибка 524 A timeout occurred
Ошибка 524 возникает, когда подключение с веб-сервером установлено, но он не ответил за установленное время ожидания соединения:
Время ожидания HTTP-ответа на CloudFlare — 100 секунд. Если веб-сервер не предоставил ответ, система выдаст 524 ошибку.
Основные причины:
- длительная работа PHP-процесса или запроса к базе данных;
- веб-сервер перегружен. Проверьте доступные ресурсы сервера, в том числе процессор и оперативную память.
Если вы регулярно выполняете тяжёлые запросы, которые могут занять больше 100 секунд, переместите эти процессы на субдомен, который не проксимируется в Cloudflare.
Рекомендации по исправлению ошибки 524 даны в справке CloudFlare.
Техническая поддержка
Специалисты REG.RU не оказывают техническую поддержку по сервису CloudFlare. Для устранения ошибки обратитесь в техническую поддержку CloudFlare. Если некорректная работа сайта связана с хостингом REG.RU, напишите заявку в службу технической поддержки.
Ошибки 520-524 требуют много знаний о сервере и его работе, поэтому самый верный способ решить проблему ― обратиться к хостинг-провайдеру, администратору сайта или к технической поддержке CloudFlare (если проблема на стороне их сервиса).
- Unknown Error — ошибка 520
- Web Server Is Down — ошибка 521
- Connection timed out — ошибка 522
- A timeout occurred — Ошибка 524
520, 521, 522, 524 — это нестандартные типы ошибок, которые можно встретить при использовании сервиса CloudFlare. CloudFlare — сервис, с помощью которого можно перенаправить трафик на сайт, ускорить загрузку его страниц и настроить дополнительную защиту от DDoS-атак. Cloudflare работает как обратный прокси-сервер для сайта.
Unknown Error — ошибка 520
Если CloudFlare не может обработать ответ от веб-сервера, на котором расположен сайт, вы увидите ошибку 520:

Возможные причины ошибки:
- сервер дает некорректный ответ;
- приходит пустой ответ от сервера;
- сервер разорвал соединение после успешного запроса;
- заголовок запроса превышает ограничение размера (более 8 КБ).
Исправить ошибку 520 можно с помощью инструкций в справке CloudFlare.
Web Server Is Down — ошибка 521
Если между веб-сервером и CloudFlare оборвалось соединение, вы увидите ошибку 521:

Основные причины ошибки:
- сервер недоступен или не отвечает — проверьте работоспособность сервера;
- веб-сервер блокирует все запросы. Поскольку CloudFlare работает по принципу обратного прокси-сервера, все запросы приходят от IP-адресов системы. Система безопасности принимает регулярные подключения с одинаковых адресов IP за DDoS-атаку. Из-за этого накладываются ограничения по скорости.
На официальном сайте можно увидеть диапазон IP-адресов CloudFlare. Ошибку 521 можно исправить с помощью инструкций в справке CloudFlare.
Connection timed out — ошибка 522
Если время ожидания ответа от веб-сервера превышено, вы увидите ошибку 522:

Ошибка может возникнуть, если:
- веб-сервер недоступен;
- веб-сервер перегружен и не отвечает;
- запросы от CloudFlare блокирует система защиты веб-сервера;
- некорректные настройки маршрутизации между веб-сервером и CloudFlare;
- в настройках DNS на CloudFlare установлен некорректный IP-адрес.
Перед решением проблемы убедитесь, что ваш веб-сервер принимает HTTP-запросы. Также проверьте, что DNS в Личном кабинете на CloudFlare настроены корректно. Ошибку 522 можно исправить с помощью инструкций в справке CloudFlare.
A timeout occurred — Ошибка 524
В случае когда подключение с веб-сервером установлено, но он не успел ответить за установленное время ожидания, может возникнуть ошибка 524. Время ожидания HTTP-ответа на CloudFlare — 100 секунд.

Основные причины ошибки:
- перегружен веб-сервер (проверьте процессор, оперативную память и другие ресурсы сервера);
- задержка запроса к базам данных или PHP-процесса.
Ошибку 522 можно исправить с помощью инструкций в справке CloudFlare.
Обратите внимание!
Специалисты 2domains не оказывают техническую поддержку по сервису CloudFlare. По вопросам возникновения ошибок обращайтесь в техническую поддержку CloudFlare. Если некорректная работа сайта связана с хостингом 2domains, оставьте заявку в клиентскую службу.
В этой статье опишем наиболее часто встречающиеся серверные ошибки 5хх. Для wordpress сайта это так же актуально, как и для всех прочих движков.
Ввиду обширности информации в данной статье будут описаны только возможные причины, приводящие к проблемам, но не способы их устранения, хотя эти способы в большинстве случаев вытекают из причин.
Некоторые ошибки можно видеть довольно часто, а другие (начиная примерно с 505) вы, возможно, никогда не встретите. В некоторых случаях они носят скорее экспериментальный характер.
Содержание
- 500 Internal Server Error – внутренняя ошибка сервера
- Наиболее частые причины возникновения
- 501 Not Implemented – не реализовано
- 502 Bad Gateway — ошибка шлюза
- 503 Service Unavailable – сервис недоступен
- 504 Gateway Timeout — истекло время ожидания
- 505 HTTP Version Not Supported — версия http не поддерживается
- 506 Variant Also Negotiates — вариант тоже проводит согласование
- 507 Insufficient Storage — переполнение хранилища
- 509 Bandwidth Limit Exceeded — исчерпана пропускная ширина канала
- 510 Not Extended — не расширено
- 511 Network Authentication Required — требуется сетевая аутентификация
- 520 Unknown Error — неизвестная ошибка
- 521 Web Server Is Down — веб-сервер не работает
- 522 Connection Timed Out — соединение не отвечает
- 523 Origin Is Unreachable — источник недоступен
- 524 A Timeout Occurred — время ожидания истекло
- 525 SSL Handshake Failed – квитирование SSL не удалось
- 526 Invalid SSL Certificate — недействительный сертификат SSL
500 Internal Server Error – внутренняя ошибка сервера
Это самая распространенная ошибка, возникающая при работе интернет-сайтов. Данный http код генерируется при любой проблеме, не входящей в рамки остальных ошибок. Учитывая это, к данной проблеме могут приводить множество причин.

Наиболее частые причины возникновения
Ошибка в коде. Самый простой пример, если вы в php коде забыли поставить ‘;’ после команды, это, вероятно, приведет к проблеме. Точно так же могут возникать ошибки при работе плагинов после их обновления, если конфигурация сервера не поддерживает какие-то вновь появившиеся в них команды.
Кстати, возникающие 500 ошибки записываются в лог сервера, и вы можете его посмотреть, чтобы диагностировать причину. Лог ошибок формируется практически на любом хостинге, но в некоторых случаях вам нужно включить логирование в своем кабинете хостинга.
Кроме того, к ошибке 500 могут привести причины:
- неправильно выставленные права на файлы и папки;
- неверные директивы, указанные в файле .htaccess;
- скрипт долго выполняется (превышено время ожидания);
- нехватка оперативной памяти сервера для выполнения скрипта.
Как избавиться от этой ошибки вы можете прочитать в отдельной статье о http error 500.
501 Not Implemented – не реализовано
Сервер не поддерживает возможностей, которые нужны для обработки запроса. То есть сервер не может выполнить http запрос, полученный от клиента из-за ограничений функционала.
Возможные причины
- Вредоносная программа или вирус перехватила контроль или повредила ваш интернет-браузер.
- В реестре Windows произошло повреждение из-за изменения программного обеспечения, связанного с Windows, например, установка или удаление программы.
502 Bad Gateway — ошибка шлюза
Это означает, что сервер, выступая в роли шлюза или прокси-сервера, получил недопустимый ответ от следующего в цепочке запросов сервера (вышестоящего сервера). По моей практике такое частенько происходит, когда ваш сервер перегружен.

503 Service Unavailable – сервис недоступен
Сервер временно не может техническим причинам обрабатывать запросы. Это может происходить из-за режима обслуживания или перегрузок сервера. При этом вместе с кодом ошибки может отображаться значение Retry-After с указанием времени, через которое клиенту рекомендуется повторить запрос (если сервер знает время задержки).
504 Gateway Timeout — истекло время ожидания
Означает, что сервер в роли прокси-сервера или шлюза не дождался ответа от следующего сервера для завершения запроса.
505 HTTP Version Not Supported — версия http не поддерживается
Сервер не поддерживает указанную в запросе версию протокола HTTP.
506 Variant Also Negotiates — вариант тоже проводит согласование
Выбранный вариант в результате ошибочной конфигурации указывает сам на себя, из-за чего процесс связывания прерывается.
507 Insufficient Storage — переполнение хранилища
Для выполнения текущего запроса не хватает места.
509 Bandwidth Limit Exceeded — исчерпана пропускная ширина канала
Возникает, если хостинг-провайдер установил ограничение на потребление трафика веб-площадкой и оно исчерпано.
510 Not Extended — не расширено
Клиент желает использовать расширение, которое отсутствует на сервере.
511 Network Authentication Required — требуется сетевая аутентификация
Этот ответ посылается сервером провайдера в случае, если клиент должен сначала авторизоваться в сети, например, ввести пароль для платной точки доступа к интернету.
520 Unknown Error — неизвестная ошибка
Возникает когда сервер CDN (Сеть доставки и дистрибуции содержимого) не смог обработать ошибку веб-сервера, нестандартный код CloudFlare (американская компания, предоставляющая услуги CDN).
521 Web Server Is Down — веб-сервер не работает
Ошибка возникает, когда подключения CDN отклоняются веб-сервером; нестандартный код CloudFlare.
522 Connection Timed Out — соединение не отвечает
Возникает, когда CDN не удалось подключиться к веб-серверу; нестандартный код CloudFlare.
523 Origin Is Unreachable — источник недоступен
Веб-сервер недостижим; нестандартный код CloudFlare.
524 A Timeout Occurred — время ожидания истекло
Истечение таймаута подключения между сервером CDN и веб-сервером; нестандартный код CloudFlare.
525 SSL Handshake Failed – квитирование SSL не удалось
Ошибка рукопожатия SSL между сервером CDN и веб-сервером; нестандартный код CloudFlare.
526 Invalid SSL Certificate — недействительный сертификат SSL
Не удаётся подтвердить сертификат шифрования веб-сервера; нестандартный код CloudFlare.
