The 504 Gateway Timeout error is an HTTP status code that means that one server didn’t receive a timely response from another server that it was accessing while attempting to load the web page or fill another request by the browser.
In other words, 504 errors usually indicate that a different computer, one that the website you’re getting the message on doesn’t control but relies on, isn’t communicating with it quickly enough.
Lifewire / Ashley Nicole DeLeon
Are You the Web Manager? See the Fixing 504 Errors on Your Own Site section further down the page for some things to consider on your end.
A 504 Gateway Timeout error can appear in any internet browser, on any operating system, and on any device. This means that it’s possible to get the error on your Android or iPhone phone or tablet, in Safari on a Mac, in Chrome on Windows 10 (or 8, or 7, …), etc.
How You Might See the 504 Error
Individual websites are allowed to customize how they show «gateway timeout» errors, but here are the most common ways you’ll see one spelled out:
- 504 Gateway Timeout
- HTTP 504
- 504 ERROR
- Gateway Timeout (504)
- HTTP Error 504 — Gateway Timeout
- Gateway Timeout Error
A 504 Gateway Timeout error shows up inside the internet browser window, just like normal web pages do. There might be a site’s familiar headers and footers and a nice, English message on the page, or it could show up on an all-white page with a big 504 at the top. It’s all the same message, regardless of how the website happens to show it.
Causes of 504 Gateway Timeout Errors
Most of the time, a 504 Gateway Timeout error means that whatever other server is taking so long that it’s «timing out,» is probably down or not working properly.
Since this error is usually a network error between servers on the internet or an issue with an actual server, the problem probably is not with your computer, device, or internet connection.
That said, there are a few things you can try, just in case:
How to Fix the 504 Gateway Timeout Error
-
Retry the web page by selecting the refresh/reload button, pressing F5, or trying the URL from the address bar again.
Even though the 504 Gateway Timeout error is reporting an error outside of your control, it might only be temporary.
-
Restart all of your network devices. Temporary problems with your modem, router, switches, or other networking hardware could be causing the 504 Gateway Timeout issue you’re seeing. Just restarting these devices could help.
While the order you turn off these devices isn’t important, the order that you turn them back on is. In general, you want to turn devices on from the outside-in. If you’re not sure what that means, check out the link at the beginning of this step for a complete tutorial.
-
Check the proxy server settings in your browser or application and make sure they’re correct. Incorrect proxy settings can cause 504 errors.
Windows 10 Proxy Settings.
Most computers don’t have proxy settings at all, so if yours are empty, just skip this step.
See Proxy.org for an updated, respected list of proxy servers that you can choose from.
-
Change your DNS servers, especially if all the devices on your network are getting the same error. It’s possible that the 504 Gateway Timeout error you’re seeing is caused by an issue with the DNS servers you happen to be using.
Unless you’ve previously changed them, the DNS servers you have configured right now are probably the ones automatically assigned by your ISP. Others are also available to choose from. See our Free & Public DNS Servers list for options.
-
If nothing has worked up to this point, contacting the website is probably the next best thing to do. There’s a good chance the website administrators are already working to fix the root cause of the 504 Gateway Timeout error, assuming they’re aware of it, but there’s nothing wrong touching base with them.
Most major sites have social networking accounts they use to help support their services and some even have telephone numbers and email addresses.
If it’s starting to look like the website might be giving a 504 error for everyone, searching Twitter for real-time information about the site’s outage is often helpful. The best way to do this is to search for #websitedown on Twitter. For example, if Facebook might be down, search #facebookdown.
-
Contact your internet service provider. It’s very likely at this point, after following all the troubleshooting above, that the 504 Gateway Timeout that you’re seeing is a problem caused by a network issue that your ISP is responsible for.
How to Talk to Tech Support
-
Come back later. You’ve exhausted all your options at this point and the 504 Gateway Timeout error is either in the hands of the website or your ISP to correct. Check back with the site regularly. No doubt it’ll start working again soon.
Fixing 504 Errors on Your Own Site
A lot of times this isn’t your fault at all, but it’s not the user’s either. Start by checking that your server can properly resolve all the domains that your applications require access to.
Very heavy traffic might result in your server serving a 504 error, even though a 503 would probably be a bit more accurate.
In WordPress specifically, 504: Gateway Timeout messages are sometimes due to corrupted databases. Install WP-DBManager and then try the «Repair DB» feature, followed by «Optimize DB,» and see if that helps.
Also, make sure your HTACCESS file is correct, especially if you have just reinstalled WordPress.
Finally, consider contacting your hosting company. It’s possible that the 504 error that your website is returning is due to an issue on their end that they’ll need to resolve.
More Ways You Might See a 504 Error
A Gateway Timeout error, when received in Windows Update, generates a 0x80244023 error code or the message WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT.
In Windows-based programs that inherently access the internet, a 504 error might show up in a small dialog box or window with the HTTP_STATUS_GATEWAY_TIMEOUT error and/or with a The request was timed out waiting for a gateway message.
A less common 504 error is Gateway Time-out: The proxy server did not receive a timely response from the upstream server, but the troubleshooting (above) remains the same.
Errors Like 504 Gateway Timeout
A number of error messages are similar to the 504 Gateway Timeout error because they all occur on the server side. A few include the 500 Internal Server Error, the 502 Bad Gateway error, and the 503 Service Unavailable error, among a few others.
There are also HTTP status codes that aren’t server-side, but instead client-side, like the commonly seen 404 Not Found error. Several others exist as well, all of which you can see in our HTTP Status Code Errors page.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
The 504 Gateway Timeout error is an HTTP status code that means that one server didn’t receive a timely response from another server that it was accessing while attempting to load the web page or fill another request by the browser.
In other words, 504 errors usually indicate that a different computer, one that the website you’re getting the message on doesn’t control but relies on, isn’t communicating with it quickly enough.
Lifewire / Ashley Nicole DeLeon
Are You the Web Manager? See the Fixing 504 Errors on Your Own Site section further down the page for some things to consider on your end.
A 504 Gateway Timeout error can appear in any internet browser, on any operating system, and on any device. This means that it’s possible to get the error on your Android or iPhone phone or tablet, in Safari on a Mac, in Chrome on Windows 10 (or 8, or 7, …), etc.
How You Might See the 504 Error
Individual websites are allowed to customize how they show «gateway timeout» errors, but here are the most common ways you’ll see one spelled out:
- 504 Gateway Timeout
- HTTP 504
- 504 ERROR
- Gateway Timeout (504)
- HTTP Error 504 — Gateway Timeout
- Gateway Timeout Error
A 504 Gateway Timeout error shows up inside the internet browser window, just like normal web pages do. There might be a site’s familiar headers and footers and a nice, English message on the page, or it could show up on an all-white page with a big 504 at the top. It’s all the same message, regardless of how the website happens to show it.
Causes of 504 Gateway Timeout Errors
Most of the time, a 504 Gateway Timeout error means that whatever other server is taking so long that it’s «timing out,» is probably down or not working properly.
Since this error is usually a network error between servers on the internet or an issue with an actual server, the problem probably is not with your computer, device, or internet connection.
That said, there are a few things you can try, just in case:
How to Fix the 504 Gateway Timeout Error
-
Retry the web page by selecting the refresh/reload button, pressing F5, or trying the URL from the address bar again.
Even though the 504 Gateway Timeout error is reporting an error outside of your control, it might only be temporary.
-
Restart all of your network devices. Temporary problems with your modem, router, switches, or other networking hardware could be causing the 504 Gateway Timeout issue you’re seeing. Just restarting these devices could help.
While the order you turn off these devices isn’t important, the order that you turn them back on is. In general, you want to turn devices on from the outside-in. If you’re not sure what that means, check out the link at the beginning of this step for a complete tutorial.
-
Check the proxy server settings in your browser or application and make sure they’re correct. Incorrect proxy settings can cause 504 errors.
Windows 10 Proxy Settings.
Most computers don’t have proxy settings at all, so if yours are empty, just skip this step.
See Proxy.org for an updated, respected list of proxy servers that you can choose from.
-
Change your DNS servers, especially if all the devices on your network are getting the same error. It’s possible that the 504 Gateway Timeout error you’re seeing is caused by an issue with the DNS servers you happen to be using.
Unless you’ve previously changed them, the DNS servers you have configured right now are probably the ones automatically assigned by your ISP. Others are also available to choose from. See our Free & Public DNS Servers list for options.
-
If nothing has worked up to this point, contacting the website is probably the next best thing to do. There’s a good chance the website administrators are already working to fix the root cause of the 504 Gateway Timeout error, assuming they’re aware of it, but there’s nothing wrong touching base with them.
Most major sites have social networking accounts they use to help support their services and some even have telephone numbers and email addresses.
If it’s starting to look like the website might be giving a 504 error for everyone, searching Twitter for real-time information about the site’s outage is often helpful. The best way to do this is to search for #websitedown on Twitter. For example, if Facebook might be down, search #facebookdown.
-
Contact your internet service provider. It’s very likely at this point, after following all the troubleshooting above, that the 504 Gateway Timeout that you’re seeing is a problem caused by a network issue that your ISP is responsible for.
How to Talk to Tech Support
-
Come back later. You’ve exhausted all your options at this point and the 504 Gateway Timeout error is either in the hands of the website or your ISP to correct. Check back with the site regularly. No doubt it’ll start working again soon.
Fixing 504 Errors on Your Own Site
A lot of times this isn’t your fault at all, but it’s not the user’s either. Start by checking that your server can properly resolve all the domains that your applications require access to.
Very heavy traffic might result in your server serving a 504 error, even though a 503 would probably be a bit more accurate.
In WordPress specifically, 504: Gateway Timeout messages are sometimes due to corrupted databases. Install WP-DBManager and then try the «Repair DB» feature, followed by «Optimize DB,» and see if that helps.
Also, make sure your HTACCESS file is correct, especially if you have just reinstalled WordPress.
Finally, consider contacting your hosting company. It’s possible that the 504 error that your website is returning is due to an issue on their end that they’ll need to resolve.
More Ways You Might See a 504 Error
A Gateway Timeout error, when received in Windows Update, generates a 0x80244023 error code or the message WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT.
In Windows-based programs that inherently access the internet, a 504 error might show up in a small dialog box or window with the HTTP_STATUS_GATEWAY_TIMEOUT error and/or with a The request was timed out waiting for a gateway message.
A less common 504 error is Gateway Time-out: The proxy server did not receive a timely response from the upstream server, but the troubleshooting (above) remains the same.
Errors Like 504 Gateway Timeout
A number of error messages are similar to the 504 Gateway Timeout error because they all occur on the server side. A few include the 500 Internal Server Error, the 502 Bad Gateway error, and the 503 Service Unavailable error, among a few others.
There are also HTTP status codes that aren’t server-side, but instead client-side, like the commonly seen 404 Not Found error. Several others exist as well, all of which you can see in our HTTP Status Code Errors page.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
Ошибка 504 Gateway Time out – это код состояния HTTP, который означает, что один сервер не получил своевременный отклик от другого сервера, к которому он обратился, пытаясь загрузить веб-страницу или выполнить запрос браузера. Она может возникать вместе с 502 Bad Gateway.
Другими словами, ошибка 504 указывает на то, что у сервера, на котором расположен сайт и у компьютера, на котором выскакивает ошибка 504, отсутствует стабильное достаточно быстрое соединение с интернетом.
- Как можно увидеть ошибку 504 Gateway Time out
- Причины возникновения ошибки 504 Gateway Time out
- Как исправить ошибку 504 Gateway Time out
- Исправление ошибки 504 Gateway Time out на вашем собственном сайте
- Больше способов увидеть ошибку 504 Gateway Time out
- Ошибки похожие на 504 Gateway Time out
Отдельным сайтам разрешено настраивать отображение ошибки Gateway Timeout. Вот несколько распространенных способов вывода подобной ошибки:
504 Gateway Timeout HTTP 504 504 ERROR Gateway Timeout (504) HTTP Error 504 - Gateway Timeout Gateway Timeout Error
Ошибка 504 Gateway Time out появляется внутри окна браузера, как обычная веб-страница. На ней могут быть знакомые верхние и нижние колонтитулы сайта и красивое английское сообщение. Также подобная ошибка может отображаться на полностью белой странице с большой цифрой 504 вверху. Это одно и то же сообщение, независимо от того, как сайт показывает его вам.
Помните, что ошибка 504 Gateway Time out и 502 Bad Gateway nginx может появиться в любом браузере, операционной системе и на любом устройстве.
В большинстве случаев ошибка 504 Gateway Timeout означает, что любой сервер, который выдает «тайм-аут», «упал» или неправильно работает.
Поскольку эта ошибка обычно возникает между серверами в интернете, то, вероятно, она не связана с вашим компьютером, устройством или интернет-соединением.
Перезагрузите веб-страницу, нажав кнопку обновление / перезагрузка, в F5 или повторив URL-адрес из адресной строки.
Несмотря на то, что 504 Gateway Timeout и ошибка 502 Bad Gateway сообщает о неподконтрольной вам ошибке, проблема может быть временной. Просто перезагрузите страницу — это быстро и легко.
- Перезапустите все сетевые устройства. Временные проблемы с модемом, маршрутизатором, коммутаторами или другим сетевым оборудованием могут вызывать ошибку 504 Gateway Timeout. Простой перезапуск этих устройств может помочь.
Подсказка: При том, что порядок выключения этих устройств не важен, порядок включения их наоборот очень важен.
- Проверьте настройки прокси-сервера в своем браузере или приложении. Убедитесь, что они верны. Неправильные настройки прокси-сервера могут вызвать 504 ошибку.
Подсказка. Смотрите Proxy.org обновленный, проверенный список прокси-серверов, которые можно использовать.
Примечание. Большинство компьютеров не имеют настроек прокси-сервера, поэтому, если ваши настройки пусты, пропустите этот шаг.
- Измените DNS-сервер. Возможно, ошибка 504 Gateway Timeout, которую вы видите, вызвана проблемой с DNS-сервером, который вы используете.
Примечание. DNS-сервер, используемый сейчас, вероятно, автоматически назначается вашим провайдером. К счастью, для использования доступны другие DNS-сервера, которые можно выбрать.
Подсказка. Если не все сетевые устройства получают ошибку HTTP 504 или 502 error Bad Gateway, но все они находятся в одной сети, изменение DNS-сервера не сработает. Если это похоже на вашу ситуацию, переходите к следующей идее.
- Если изменений не произошло, обратитесь к сайту. Это единственное, что вы можете сделать. Велика вероятность, что администраторы сайта уже работают, чтобы исправить первопричину ошибки 504 Gateway Timeout.
На большинстве сайтов есть учетные записи социальных сетей, которые они используют для поддержки. А некоторые даже имеют номера телефонов и адреса электронной почты.
Подсказка. Если начинает казаться, что сайт выдает 504 ошибку для всех, поищите в Twitter в режиме реального времени информацию о недоступности сайта. Лучший способ сделать это — найти #websitedown в Twitter. Например, если Facebook может быть недоступен, выполните поиск по тегу #facebookdown.
- Обратитесь к своему интернет-провайдеру. Вероятнее всего, что после описанного выше устранения неполадок, выскакивающая 504 Gateway Timeout — это проблема, вызванная неполадками в Сети, за которую отвечает ваш провайдер.
- Вернуться позже. На данный момент вы исчерпали все варианты, и ошибка 504 Gateway Timeout устраняется администратором сайта или интернет-провайдером.
Регулярно проверяйте сайт. Без сомнения, он снова начнет работать.
В большинстве случаев это происходит не по вашей вине, но и не по вине пользователей вашего ресурса. Начните с проверки того, что сервер может правильно предоставлять доступ ко всем доменам, к которым требуют доступ ваши приложения.
Большие объемы трафика могут привести к тому, что ваш сервер будет выдавать ошибку 504. Хотя 503 или ошибка 502 Bad Gateway будет более вероятна.
В частности, в WordPress сообщение 504: Gateway Timeout иногда возникает из-за поврежденных баз данных. Установите WP-DBManager и попробуйте применить функцию «Восстановить БД», а затем «Оптимизировать БД». Посмотрите, поможет ли это.
Убедитесь, что ваш файл HTACCESS правильный. Особенно если вы только что переустановили WordPress.
Свяжитесь с технической поддержкой хостинга. Возможно, ошибка 504, возвращаемая вашим сайтом, связана с проблемой на их стороне, которую они должны решить.
Ошибка Gateway Timeout при получении в Windows Update генерирует код ошибки 0x80244023 или сообщение WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT.
В программах на базе Windows, которые изначально обращаются к интернету, ошибка 504 может отображаться в небольшом диалоговом окне или окне с ошибкой HTTP_STATUS_GATEWAY_TIMEOUT и/или сообщение The request was timed out waiting for a gateway (истекло время ожидания запроса для шлюза).
Менее распространенная ошибка 504 — это Gateway Time-out: The proxy server did not receive a timely response from the upstream server (прокси-сервер не получил своевременного ответа от вышестоящего сервера), но поиск и устранение неисправностей (указанных выше) продолжается.
Ряд сообщений об ошибках аналогичен ошибке 504 Gateway Timeout, поскольку все они происходят на стороне сервера. Некоторые включают в себя ошибку 500 Internal Server («Внутренняя ошибка сервера»), ошибку 502 Bad Gateway (что это означает — «Неверный шлюз»), и ошибку 503 Service Unavailable («Сервис временно недоступен»), среди нескольких других.
Существуют также коды статуса HTTP, которые не являются серверными, а возникают на клиентской стороне. Например, часто встречающаяся ошибка 404 Not Found («Страница не найдена»).
Код ошибки в формате 5хх говорит о том, что на стороне сервера есть проблема: сервер не может обработать запрос от клиента. Клиентом в данном случае выступает браузер.
Ошибка 504 Gateway Time Out возникает, когда в заданный промежуток времени сервер не получает ответ от другого сервера, при этом другой сервер выполняет роль прокси или шлюза.
Ошибка 504 что значит
Какие ещё бывают варианты отображения ошибки:
- HTTP Error 504,
- Gateway Timeout Error,
- HTTP Error 504 – Gateway Timeout,
- 504 Gateway Timeout nginx,
- 504 Gateway Time-out – The server didn’t respond in time,
- Ошибка 504 Время ответа сервера истекло,
- Время ожидания шлюза (504),
- Ошибка тайм-аута шлюза,
- HTTP 504,
- 504 Ошибка.
В этой статье мы расскажем, как устранить код ошибки 504.
Как исправить ошибку 504 посетителю сайта
Итак, вы перешли на сайт, но вместо веб-страницы видите сообщение с кодом 504.
Что такое тайм аут шлюза
Проблема может быть как со стороны сайта, так и со стороны устройства, например настроек браузера.
Чтобы убедиться в том, что настройки браузера в порядке:
1) Обновите страницу. Но обновите не клавишей F5, а выделите содержимое адресной строки и нажмите Enter. Если после этих действий ошибка 504 не возникает ни на текущем, ни на любом другом сайте – её можно проигнорировать.
2) Зайдите на тот же ресурс через другой браузер. Если в этом случае сайт открылся корректно, перейдите к следующему пункту.
3) Очистите кэш браузера и удалите файлы cookie. После этого браузер будет работать быстрее.
Воспользуйтесь инструкцией Как очистить кэш браузера.
4) Перезагрузите роутер или модем. Отключите устройство от сети примерно на 10 минут.
5) Очистите кэш DNS. Для этого воспользуйтесь инструкцией ниже.
Как очистить кэш DNS
В зависимости от вашей операционной системы очистите кэш по одной из инструкций.
1) Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:
2) Введите команду:
3) Дождитесь сообщения об очистке кэша:
1) Откройте терминал клавишами Ctrl+Alt+T.
2) Введите команду:
Для Ubuntu:
sudo service network-manager restart
Для других дистрибутивов:
sudo /etc/init.d/nscd restart
1) Войдите в терминал. Для этого нажмите клавиши Command + Space. Введите Терминал и нажмите на найденное приложение.
2) Введите команду:
sudo killall -HUP mDNSResponder
Готово, вы очистили кэш DNS.
6) Обратитесь в техподдержку вашего интернет-провайдера. Возможно, это проблема сети, за которую отвечает провайдер.
Если эти действия не принесли результата – обратитесь в техническую поддержку сайта.
Если вы владелец сайта
Как исправить ошибку 504 на виртуальном хостинге
1 способ
Эта ошибка может возникнуть в случае, если для Nginx был превышен лимит на время ответа сайта. По умолчанию это 30 секунд, при этом среднее время загрузки сайта не должно превышать 1-3 секунды.
Если скрипты вашего сайта должны исполняться дольше 30 секунд, вы можете миновать Nginx и обратиться к сайту по другим портам. Если ваша панель управления хостингом:
- ISPManager – используйте порт 8081
- cPanel или Plesk – используйте порт 8080.
2 способ
Если этот вариант вам не подходит, рекомендуем перенести ваш сайт на Облачный сервер, на котором доступна гибкая настройка сервера, в том числе и лимитов. Для этого закажите услугу «Облачные серверы» и перенесите сайт по инструкции Как перенести сайты между услугами REG.RU.
3 способ
Также вы можете изменить директиву max_execution_time в файле php.ini. Она указывает на время, за которое должен отрабатываться скрипт. Для этого:
- 1.
-
2.
Укажите нужное значение в строке:
Где 30 – время выполнения скрипта в секундах.
4 способ
Если вы используете CDN, проблема может быть связана с ней.
Что такое CDN
CDN – это сетевая инфраструктура, которая распределена географически. Она обеспечивает быструю загрузку контента пользователям веб-сервисов и сайтов. Серверы, которые входят в состав CDN, географически расположены так, чтобы сделать время ответа сайта или сервиса минимальным для пользователей.
Пользователь ищет ресурс и тем самым посылает запрос. Запрос идентифицируется и направляется на PoP – на ближайший к пользователю кэширующий сервер в этой инфраструктуре. Возможны два варианта:
- Если в кэше PoP есть данные об этом запросе, он отвечает браузеру, а тот отображает контент.
- Если в кэше этого сервера нет данных, запрос переадресовывается к ориджину – центральному серверу, на котором хранятся все данные. Когда ориджин отвечает на запрос, PoP кэширует его и передаёт ответ браузеру. После этого контент отображается в браузере.
Ошибку 504 может вернуть кэширующий сервер, если превышено время ожидания от центрального сервера.
Если ошибку исправить не удалось, обратитесь в техническую поддержку.
Как исправить ошибку 504 на VPS
1 способ
Эта ошибка может возникнуть в случае, если для Nginx был превышен лимит на время ответа сайта. По умолчанию это 30 секунд, при этом среднее время загрузки сайта не должно превышать 1-3 секунды.
Чтобы избавиться от этой ошибки, попробуйте повысить время ожидания веб-сервера Nginx.
2 способ
Также ошибка 504 может возникать, когда Nginx используется как прокси-сервер для Apache. В этом случае нужно настроить параметры времени ожидания при проксировании. Максимальное время исполнения скрипта в настройках веб-сервера — 300 секунд.
Изменить параметры ожидания можно в конфигурационном файле nginx.conf. Для этого:
-
1.
Подключитесь к серверу по SSH.
-
2.
Откройте конфигурационный файл с помощью команды:
sudo nano /etc/nginx/nginx.conf -
3.
Добавьте строки в блоке server:
#server { #... proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; #... #}Где 600 — время в секундах.
-
4.
Перезапустите Nginx с помощью команды:
Если решить проблему не удалось, обратитесь в техническую поддержку или на тематические форумы по Nginx.




