Check the browser cookies and cache or switch to a public DNS server
by Matthew Adams
Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things… read more
Updated on August 11, 2022
Fact checked by
Alex Serban

After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server… read more
- Users reported getting DNS lookup failed errors when using their browsers.
- If you too encountered this error message, clear the browser cookies and cache, or flush the DNS, amongst other methods here.
- Also, find out how to find the DNS server in Windows.

- Easy migration: use the Opera assistant to transfer exiting data, such as bookmarks, passwords, etc.
- Optimize resource usage: your RAM memory is used more efficiently than in other browsers
- Enhanced privacy: free and unlimited VPN integrated
- No ads: built-in Ad Blocker speeds up loading of pages and protects against data-mining
- Gaming friendly: Opera GX is the first and best browser for gaming
- Download Opera
The DNS lookup failed message on the browser is a net connection error. The Google Chrome error message states This webpage is not available. The server at… can’t be found, because the DNS lookup failed.
The error message prevents users from accessing the website, but it, in most cases, doesn’t have to do with the website at all. Rather, the error is related to misconfigured browser settings, the presence of conflicting applications, or issues with the current DNS server.
Many came across the error in these cases:
- 504 DNS lookup failed FortiGate: Users with the FortiGate firewall have reported encountering the error frequently, and disabling the firewall did the trick.
- DNS lookup failed VPN: When encountering the error while using a VPN, switching to a reliable VPN should fix the error.
So, let’s find out how you can fix the DNS lookup failed error on your browser in the following sections, and all about the error itself.
What does it mean when DNS failed?
A DNS failed error basically indicates the inability to connect to the corresponding IP address of the website. It could be to problems with the DNS server itself, misconfigured network settings, or third-party applications conflicting with it.
In most cases, the solutions are simple and things are up and running in a jiffy. Many recommend switching to public DNS servers, such as that of Google, to eliminate errors like these.
Quick Tip:
If Google Chrome persists in showing you the error message even after you tried all troubleshooting solutions, you should try using a different browser instead. Opera is a great alternative.
Not only is it incredibly powerful and lightweight, but it is also extremely stable, receiving updates after updates that are constantly maintained in peak condition.
Opera
A web browser that balances out stability, performance, a high level of customization, and low system requirements.
Why do we need DNS?
Every website on the Internet is assigned an address, which consists of a string of numbers and characters. To simplify things for users, websites are also assigned a domain name. For instance, https://windowsreport.com/, is the domain name and not the IP address.
Now, while people understand the domain name, computers, on the other hand, use the assigned IP address.
This is where the DNS (Domain Name System) server comes into the picture. When you enter the domain name in the address bar of the browser, it locates the corresponding IP address and opens the website. And when the DNS fails, the website won’t open.
What to do if the browser stops working after DNS fail?
1. Clear cookies and cache
NOTE
The steps listed here are for Chrome, but the concept and the keyboard shortcut to launch the utility remains the same for all major browsers.
- Launch the browser, and press Ctrl + Shift + Del to open the Clear browsing data utility.
- Select All time from the Time range dropdown menu.

- Select the checkboxes for Browsing history, Cookies and other site data, and Cached images and files, and then click on Clear data at the bottom.

Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken.
We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.
If the manual method seems like too much of a hassle, you could always opt for a third-party PC cleaner. This type of tool will scan your browser for unnecessary clutter and let you know what can be removed.
Alongside cleaning your browser, dedicated cookie cleaners generally include other PC optimization tools such as registry cleaners and startup editors.
On top of that, some browser cleaners will help you remove unwanted toolbars and plugins, remove spam/useless emails, and more.
We recommend CCleaner from the list of software we tested, which performs thorough cleaning, as one of the best tools for this task.
CCleaner makes it simple to get the most out of your computer because PC maintenance has to be at the top of the priority list. Furthermore, if you can tune up your computer on a regular basis, you’ll be more satisfied with its overall performance.
Once done, check if the DNS lookup failed error on the browser is fixed.
2. Open the Internet Connections Troubleshooter
- Press Windows + I to open the Settings app, and click on Troubleshoot on the right.

- Next, click on Other troubleshooters.

- Locate the Internet Connections option here, and click on the Run button next to it.

- Then go through the suggested resolutions from the troubleshooter.
Once done, check if the DNS lookup still fails intermittently on the browser. If that’s the case, head to the next method.
3. Change the DNS Server
- Press Windows + S to launch the Run command, enter ncpa.cpl in the text field, and click OK.

- Right-click the active connection to select Properties.

- Now, select Internet Protocol Version 4 (TCP/IPv4), and click the Properties button.

- Select the Use the following DNS server addresses radio button, and enter the following DNS server in the two fields:
- Preferred DNS server: 8.8.8.8
- Alternate DNS server: 8.8.4.4

- Click the OK button at the bottom of this and other windows to save the changes.
4. Flush the DNS
- Press Windows + S to open the Search menu, enter Terminal in the text field, right-click on the relevant search result, and select Run as administrator.

- Click Yes in the UAC prompt.

- Press Ctrl + Shift + 2 to open Command Prompt in a new tab.
- Now, paste the following command and hit Enter:
ipconfig /flushdns
Flushing the DNS cache is a straightforward potential resolution for the DNS lookup failed error on browsers.
5. Restart the Network Stack
- Press Windows + X to open the Quick Access menu, and select Windows Terminal (Admin).

- Click Yes in the UAC prompt.

- Click on the arrow at the top, and select Command Prompt from the menu.

- Now, paste the following command and hit Enter:
netsh winsock reset catalog
- Once done, restart the computer for the changes to come into effect.
Some users might need to restart a corrupted network stack to fix the DNS lookup failed error on the browser.
How do I find my DNS server?
- Press Windows + R to open Run, type ncpa.cpl in the text field, and click OK.

- Now, double-click on the active network adapter.

- Click on Details.

- You will now find the DNS server listed here.

The above resolutions will probably resolve the DNS lookup failed error for most users so that they can open webpages in Chrome and other browsers, whenever the error is encountered
Also, find out what to do when seeing the Your DNS server might be unavailable error message in Windows 10/11.
Tell us which fix worked for you in the comments section below.
Newsletter
Description
This article describes a technical tip to prevent and/or troubleshoot “504 DNS lookup Failed” errors in case the Explicit Web Proxy feature is configured in a non-management VDOM.
Solution
When configured as an Explicit Web Proxy server, the FortiGate typically needs to perform Domain Name resolution in order to fulfill clients’ requests. To do so, the FortiGate relies on the DNS system settings which are configured in the “config system dns” section. This works fine when the Explicit Web Proxy feature is configured in the management VDOM (‘root’ VDOM by default) since this VDOM inherits the DNS settings configured globally.
In case the Explicit Web Proxy is configured in a non-management VDOM, the DNS configuration as defined in the “config system dns” section does not apply. As a result, browsing actions issued by the clients will end by default with a “504 DNS look up failed” error such as the following:

Bypassing the issue consists in configuring the DNS settings at the VDOM level (in the VDOM the Explicit Web Proxy feature is configured) so that the FortiGate can perform Domain Name resolution successfully. This can be done by using the “config system vdom-dns” section specific to the VDOM. At the minimum, DNS needs to be enabled for the VDOM using “set vdom-dns enable” and an IPv4 or IPv6 primary address defined using “set primary <dns_ipv4>” or “set ip6-primary <dns_ipv6>”.
config system vdom-dns
set ip6-primary <dns_ipv6>
set ip6-secondary <dns_ip6>
set primary <dns_ipv4>
set secondary <dns_ip4>
set source-ip <ipv4_addr>
set vdom-dns {disable | enable}
end
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 («Страница не найдена»).
Чтобы на веб-странице появился контент, браузер должен получить от сервера, на котором расположен сайт, необходимые данные. Когда на устройстве пользователя, на веб-сервере или на другом промежуточном узле (например, прокси) возникают неполадки, вместо содержимого сайта в браузере появляется страница с ошибкой. Для устранения сбоя, необходимо знать, на чьей стороне он произошел и по какой причине. Понять, что является источником проблемы, помогает цифровой код ошибки. Если он имеет формат 5xx, значит, сбой происходит на стороне сервера. Разбираем в статье ошибку 504 на сайте и способы ее устранения.
Что значит ошибка 504 и когда она появляется
Ошибка 504 Gateway Time Out — это ошибка, возникающая при загрузке сайта, если запрос пользователя передавался на сервер, хранящий данные веб-ресурса, через промежуточный сервер, действующий как шлюз или прокси, и в процессе обработки данного запроса один из серверов не получил ответ от другого в течение максимально допустимого времени ожидания. Обмен данными происходит по HTTP, и если возникает «тайм-аут шлюза», браузер показывает на веб-странице код 504, указывающий на соответствующее состояние протокола.

На выполнение некоторых операций на сервере выделяется определенное количество времени. Например, обработка http-запроса на Nginx по умолчанию должна быть завершена за 30 секунд. Лимит времени устанавливается для того, чтобы при избыточной нагрузке сервер мог прервать процесс, который не может выполнить, и перейти к следующей задаче. Средняя продолжительность загрузки сайта составляет всего 1–3 секунды, однако иногда она может увеличиваться, например, если сервер выполняет ресурсоемкие скрипты. Когда на это требуется больше максимально допустимого времени, соединение с клиентом (браузером) разрывается и возникает один из вариантов сообщения «HTTP Error 504 — Gateway Timeout». К повышенной нагрузке на сервер могут привести внутренние сбои на сайте, проблемы с безопасностью, настройки браузера и так далее.
Если говорить простыми словами, то ошибка 504 означает, что сервер, на котором расположен сайт, не успевает вовремя обработать запрос и ответить пользователю.
Как исправить ошибку 504 владельцу сайта
Чтобы исправить ошибку 504, необходимо установить и устранить причину ее возникновения. Некоторые способы решения проблемы требуют вмешательства администратора сайта.
Долго обрабатывается скрипт
Если скрипт тяжелый, сервер может не успеть полностью его обработать до появления ошибки. Лучшим решением проблемы будет облегчение скрипта или его замена. Когда это невозможно, увеличивают период ожидания сервера. Лимит времени, за которое скрипт должен быть отработан, устанавливается через директиву «max_execution_time» в файле «php.ini». По умолчанию он составляет 30 секунд. Чтобы он стал больше, необходимо открыть файл и подставить в строку «max_execution_time = 30» новую допустимую продолжительность операции. Кроме того, поменять настройки можно в Nginx и Apache.
Нестандартные параметры времени ожидания сервера могут понадобиться, если вы используете Nginx в качестве прокси-сервера для Apache. Изменение времени выполнения скрипта на веб-сервере производится в файле «nginx.conf». Порядок действий:
- Подключение к серверу по Secure Shell (протоколу для удаленного управления операционной системой).
- Ввод команды «sudo nano/etc/nginx/nginx.conf» для запуска файла.
-
Редактирование блока server: увеличение времени до наступления тайм-аута с 300 секунд до 600:

- Перезагрузка веб-сервера командой «service nginx reload».
Коррекцию файлов «php.ini» и «nginx.conf» лучше проводить совместно. В обоих документах необходимо указать одинаковое время обработки запроса.
При использовании Apache время обработки запроса редактируется через «httpd.conf». Что необходимо сделать:
- Открыть файл.
-
Ввести строку:

- Сохранить корректировки и заново запустить сервер.
Проблемы с CDN
CDN ― это несколько связанных серверов, предназначенных для того, чтобы ускорить передачу данных сайта его пользователям. CDN сохраняют контент, часто запрашиваемый аудиторией, на кеш-сервере. При повторном запросе этих данных сервер достает их из временной памяти. Таким образом, снижается нагрузка на сервер, являющийся источником контента, и сокращается время обработки запросов пользователей.
Иногда ошибка 504 может возникать при использовании CDN. Если после отключения от системы работоспособность сайта восстановится, сообщите о проблеме разработчикам сервиса.
Выросла нагрузка на один из серверов
К повышенной нагрузке на сервер может привести резкий рост трафика. Наплыв пользователей может быть связан как с намеренными действиями владельца веб-ресурса — с запуском рекламной кампании, так и со случайными событиями — временным увеличением спроса на сезонный товар, продающийся в интернет-магазине. Поскольку количество операций, которое сервер может выполнять одновременно, ограничено его вычислительной мощностью, при избыточной нагрузке хостинг-компьютер перестает отвечать на запросы пользователей. Чтобы он снова мог отдавать данные браузеру, достаточно арендовать компьютер с более мощным железом, например, с виртуального хостинга перейти на VPS. Если планируется проведение маркетинговых мероприятий, лучше заранее арендовать дополнительные вычислительные ресурсы (оперативную память, место на жестком диске и т. д.).
В компании «Интернет Хостинг Центр» клиенты могут арендовать VPS сервер в России с бесплатной защитой от DDoS на всех тарифах. Выделенный IP и техподдержка входят в стоимость.
Проверка службы DNS
Сообщение «Error 504 — Gateway Timeout» может появиться, если DNS-служба не справилась с преобразованием доменного имени в IP-адрес. Причиной ошибки становится перенос веб-ресурса с локального ПК на веб-сервер и автоматически пропадет, после того как новые DNS-данные распространяются по всему Интернету. Процесс занимает около двух суток.
Проблемы с DNS могут возникнуть на компьютере пользователя. Для их устранения на ПК вызывается командная строка операционной системы, где вводится специальная команда для очистки DNS-кэша, в Windows — это «ipconfig /flushdns».

Спам, вирусы и DDoS-атаки
Перегрузка сервера может быть вызвана не только возросшим интересом пользователей к вашим товарам и услугам, но и менее позитивными причинами — спамом, вирусами и DDoS-атаками. Для защиты веб-ресурса от вредоносных программ и действий хакеров, необходимо предпринять несколько профилактических мер:
- проверить наличие антивируса в административной панели хостинга;
- включить защиту от DDoS;
- подключить анти-спам плагины в CMS сайта;
- проверить лог-файлы на наличие часто повторяющихся IP-адресов;
- установить SSL/TLS;
- защитить формы обратной связи с помощью капчи;
- предотвратить публикацию комментариев со ссылками на вредоносное ПО, подключив модерирование контента и так далее.
Проблемы с плагинами в CMS
Функции на сайте, созданном с помощью CMS, реализуются благодаря плагинам. Не все они работают достаточно быстро, некоторые из них обрабатываются медленно, что приводит к тайм-ауту шлюза. Чтобы проверить, не является ли установленный плагин причиной сбоя, его необходимо отключить, а затем запустить сайт без него. Если веб-ресурс загрузится, значит, нужно выбрать другой функциональный модуль.
Как решить проблему, если вы — пользователь
Неполадки могут возникнуть на стороне пользователя: в его DNS-службе, браузере, программном обеспечении, роутере или модеме. Убедитесь, что настройки ваших устройств, выставлены правильно:
- обновите страницу, заново указав URL в адресной строке и нажав кнопку ввода (Enter);
- откройте сайт в другом браузере, если в нем сбой не повторится, обновите браузер с ошибкой до последней версии;
- запустите веб-ресурс на другом устройстве, чтобы проверить, не связаны ли проблемы с программным обеспечением вашего компьютера;
- очистите файлы кэша и cookies, чтобы избавиться от ошибок, накопленных браузером за длительное время использования;
- перезагрузите роутер, чтобы устранить конфликт между обновленным ПО провайдера и вашим устройством;
- очистите кэш DNS через командную строку ОС.
Заключение
Мы разобрали самые популярные причины возникновения ошибки 504 и привели способы решения каждой из них. Надеемся, что наша статья поможет Вам справиться с любой проблемой, способной привести к тайм-ауту шлюза.
I just set up a DNS Server on my Windows Server 2012 R2 DC and joined my PC into this domain (test.local).
But now I a DNS error when trying to access an Web Application from another domain (eg. https://mail.test2.local/owa). What am I doing wrong? Everything is working fine when I switch back to the local Administrator
Traceroute and nslookup for mail.test2.local are giving me the same results for both scenarios
asked Apr 26, 2018 at 10:22
2
For the OWA website you should always create an alias within Exchange for InternalURI and ExternalURI to point to your registered domain’s name.
Please see there for the step.
By dooing so it will force you to create a splitDNS setup, to host your registred domain internally, to point mail.myregistreddomain.com to your internal IP, while in the outside world the nameserver result will be your public IP for the same domain resolution.
That will allow you to use a real certificate on that server too in the end from a know certificate authority.
answered Apr 26, 2018 at 13:49
![]()
yagmoth555♦yagmoth555
16.5k4 gold badges28 silver badges49 bronze badges