+3 votes
1.1k views
How to fix Error 504 Gateway Timeout Windows, Linux or Mac

in Internet by (550k points)
reopened | 1.1k views

1 Answer

+4 votes
Best answer

1. How to diagnose the 504 Gateway Timeout error
2. Refresh the website to solve error 504
3. How to check the Windows, Linux and Mac Proxy settings
4. How to restart all Windows, Linux and Mac network devices
5 . How to change DNS settings Windows, Linux and Mac
6. How to check recent changes of DNS Windows, Linux or Mac
7. How to troubleshoot Windows, Linux and Mac server connectivity
8. How to fix incorrect Firewall settings
9. How to configure Proxy at organizational level and fix error 504
10. How to update network drivers and fix error 504
11. How to run SFC and fix error 504
12. Other ways to fix Error 504

In the current operating systems there are a series of errors associated with processes, services, hardware , applications, but one of the most delicate and which we must always be aware of is everything related to network problems. They are important since hundreds of tasks depend on this and more if we talk about servers since not having an ideal network load many of the elements or roles will not be able to function as expected, affecting productivity at a general level..

One of the errors, or perhaps the most common, that we have at the network level is the 504 Gateway Timeout error which we see in Windows, macOS or Linux and this error simply does not allow us to access a web resource in the necessary way which prevents us from accessing business platforms, email, and in general any web page which is something we do daily.

TechnoWikis will analyze in detail what this error implies and how we can give a definitive solution to it..

What is error 504 Gateway Timeout
This error is an HTTP status code error which basically indicates that a server, which has the task of functioning as a gateway or proxy, did not receive the appropriate response, and at the requested time, from another server to the I was accessing when trying to load the web page or complete another browser request.

At the networking level, each network port, also known as Gateway, and the proxy servers are responsible for regulating the forwarding of requests to release the load from the web server and thus ensure a secure and agile transmission of data so that the cycle that is fulfilled when we try to access a website is the following:

  • An IP address is obtained from the IP name of the site to visit (the URL of the site without the heading "http: //"). This search, which covers the conversion of the IP name to an IP address, is executed thanks to the domain name servers (DNS).
  • Then an IP socket connection to that particular IP address is opened
  • Subsequently write an HTTP data stream through that socket
  • An HTTP data stream is received in response from the destination web server, this data stream includes status codes whose values ​​have been set by the HTTP protocol
In the event that in any of these steps something fails, error 504 results, so its causes can be varied.

image

All HTTP status response status codes that are in category 5xx are cataloged as server error responses. Remember that the hypertext transfer protocol (HTTP) allows communication between the client and the respective web server on which the desired content is hosted.

HTTP fulfills the function of transmitting the hypertext, hence its name, of the web page that is converted into text, images, audio and more, from the client software, but when this process takes a time exceeding that stipulated, generates error 504 Gateway Timeout..

Errors 504
Some of the errors found in category 504 are:
  • HTTP 504
  • HTTP Error 504: Gateway Timeout
  • Gateway Timeout (504)
  • Gateway Timeout Error
  • 504 Gateway Timeout
  • 504 Error
  • Error 504 Gateway Timeout

image

This error 504 as we have mentioned can be deployed in any operating system and in any type of device, whether mobile or fixed.


1. How to diagnose the 504 Gateway Timeout error


One of the most practical ways to verify this error is to use the gateway which serves as an intermediary in the communication between the local computer and the destination web server. Each computer in the network is assigned a gateway with the syntax 192.168.1. * or 192.168.0. * which establishes communication from a local network address to another local network address and when we go out to the Internet world the modem or router takes this IP and ensures that it can be in different ranges in the global network.

image

Now the time has come to see some practical solutions to correct this error completely.


2. Refresh the website to solve error 504


In some situations, the 504 Gateway Timeout error may be temporary due to a sudden drop in a service, but simply update the page where the error is generated by clicking on the Update button, pressing the F5 key or clicking on the update icon located in the URL of the address bar.

image

In many cases the content will be loaded completely without this happening to major problems.


3. How to check the Windows, Linux and Mac Proxy settings


When we use a proxy provider to navigate in a much more secure and private way but a bad configuration of its values ​​can trigger the indicated error, in this case we must access this configuration and verify that everything is according to the data provided by the supplier.
Windows
In Windows we will go to the following route:
  • Start
  • Setting
  • Network and Internet
  • Proxy

There we validate every aspect of the proxy server:

image
Mac
In the case of macOS High Sierra we will go to the following route:
  • System preferences
  • Net

There we click on the Advanced button and from the Proxies tab we will confirm the respective configuration:

image


4. How to restart all Windows, Linux and Mac network devices


In some cases the excessive and prolonged use of the network devices, such as modem or router, cause a work overload on them, affecting the network packets not being sent correctly and resulting in error 504.

To do this, it is enough to turn off our network devices for a period of 2 to 4 minutes to cool down and then connect them again and try to access the site with failure and check its ideal operation.

image


5 . How to change DNS settings Windows, Linux and Mac


The DNS server (Domain Name System) is responsible for translating IP addresses to domain names and vice versa, so it is much easier to say TechnoWikis.com than say 178.33.118.246, but in some situations the DNS can present some type of error due to excessive use of its resources.

Remember that the DNS is provided by our ISP (Internet Service Provider) and if your servers are not powerful enough it can be affected by the translation task and ending with error 504. We can access the configuration DNS of our systems and establish an IP address of public servers such as Google which has servers really capable of supporting large workloads.

Change DNS in Windows
In the case of Windows systems we will go to the following route:
  • Control Panel
  • Network and Internet
  • Center network and sharing
There we click on the Change adapter settings line and in the new window we will right click on the current network adapter and select Properties:

image

In the pop-up window we will locate the Internet Protocol version 4 line and click on the Properties button:

image

In the new window we will activate the Use the following DNS server addresses box and set the following:

  • In the Preferred DNS Server field we set 8.8.8.8
  • In the Alternative DNS Server field we set 8.8.4.4

image

Click on OK to save the changes.

Change macOS DNS
In the case of macOS High Sierra we will go to:
  • System preferences
  • Net

image

There we click on the Advanced button and in the new window we will go to the DNS section:

image

There we will click on the + sign located at the bottom and in the displayed window we will enter the IP addresses of the new DNS servers:

image

Once entered click on Accept to apply the changes.

Change DNS in Linux
In the case of Linux, in this case Ubuntu 17, we click on the configuration icon located in the upper right corner and there we click on the name of our network connection:

image

The following window will be displayed where we will select the connection again and click on the Edit button:

image

In the window that will be opened we enter the IP addresses of the desired DNS servers and click on Add:

image

Finally we click on the Save button to apply the new configuration.


6. How to check recent changes of DNS Windows, Linux or Mac


image

We have talked about the role that DNS performs on the network, the DNS is responsible for associating domain names, such as TechnoWikis.com, with specific IP addresses, and then stores that association created on a series of authorized name servers distributed throughout the world so that access to that domain is correct and valid. In this way, when we enter the TechnoWikis.com address, it is checked with a nearby DNS name server to determine which specific IP address called internet resource we must connect to access TechnoWikis.com

In the event that TechnoWikis has made recent changes to the DNS server, such as a change in IP address, this would require propagation of that change among all internet servers. This is known as DNS propagation and you should keep in mind that it is not a change that occurs immediately and may take a few hours to propagate.


7. How to troubleshoot Windows, Linux and Mac server connectivity


image

The 504 Gateway Timeout error may be generated because a server is down or inaccessible for some reason. It is important to clarify that currently most DNS servers are not hosted on a single server, but may be distributed on several systems or even depend on many third-party services for operation.

So, if any of these servers is inactive or cannot be accessed for any reason of hardware or software, it is a root to generate this error.

Log Verification
Modern web applications are capable of generating event logs of everything that happens with it, as well as with the server. Application logs are one of the ideal tools for administrators because thanks to them we have the opportunity to obtain information such as:
  • Pages that were requested
  • Servers to which a connection was established
  • Results of the database
  • Logged users and more

Something useful that server logs also offer us is the ability to generate information associated with the actual hardware running the application. Thanks to this we can verify the status of all connected services in real time and thus be able to determine if something there is incurring that the 504 error is generated.


8. How to fix incorrect Firewall settings


Remember that the purpose of a Firewall is to monitor and manage network traffic, both incoming and outgoing, to act as an access administrator, analyzing which traffic is safe and which can be classified as malicious. In this way, potentially harmful traffic will be stopped and a record is kept for administration use.

Within its security tasks, the Firewall can prevent any particular website, such as applications that rely on content delivery networks (CDNs), which are designed so that they can act as a third-party host focused on content from large as are the images or videos, so that the Firewall will detect this as a threat and prevent its connectivity resulting in error 504.

To clear up doubts, we can temporarily disable the System Firewall and make the connection attempt to discard this option.

Windows
In the case of Windows we will go to the following route:
  • Control Panel
  • Security system
  • Windows Defender Firewall
  • Customize settings

image

There, we activate the Disable Windows Defender Firewall boxes and click on OK to apply the changes.
In the case of macOS, we will go to System Preferences / Security and privacy and in the Firewall tab we proceed to disable it:

image


9. How to configure Proxy at organizational level and fix error 504


If we are IT administrators and we have the responsibility of managing the web server, we must validate that the proxy configuration is the correct way since otherwise the processing of the client's requests will not work as we wish.

For example, if we use Nginx for web server management we can access its configuration file using the following line with the desired editor:

 sudo nano /etc/nginx/nginx.conf 
There we will add the following:
 proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; 

image

We save the changes and restart the Nginx service by running:

 service nginx reload 

10. How to update network drivers and fix error 504


One cause also that we can add for this error is to have outdated drivers, which are gradually becoming obsolete with new updates of operating systems such as Windows 10, macOS High Sierra or Ubuntu 17.10.
Step 1

In the case of Windows to update the network drivers we go to the device manager using one of the following options:
  • By right clicking on the Start menu and selecting Device Manager
  • Using the key combination + R and executing the devmgmt.msc command

Once there, we go to the Network adapters section and we will right click on our adapter by selecting the Update driver option:

image

Step 2

The following will be displayed:

image

There we can update the driver online or locally if we have downloaded the update files from the manufacturer's website.


11. How to run SFC and fix error 504


SFC (System File Checker) is a Windows utility that allows us to analyze in detail the file system of the disk and rule out that some of them with failures are generating the 504 error.
To execute this, we will go to the command prompt as administrators and execute the following:
 sfc / scannow 

image

This way we rule out errors in the Windows file system.


12. Other ways to fix Error 504

Analyze content management systems and databases
Among all the causes that may result in error 504 is a period of inactivity in all HTTTP processing which directly affects utilities such as Content Management System (CMS), the database or some server application causing this error .
Go to the owner or administrator of the website to solve error 504
If any of the proposed solutions does not give a comprehensive solution to the 504 Gateway Timeout error, an acceptable resource is to contact the website administrators directly by phone, chat or mail in order to know the root by which the site Web is down, so we will clear many incognitos.
Increase proxy server resources
In a previous point we saw how to monitor the configuration of the proxy server, but if as an organization or as users we have our site hosted on a proxy server and it does not have enough hardware resources at some time it can be saturated resulting in error 504 .

For example, a website with a high volume of traffic or load peaks, such as uploading or downloading files, can be adversely affected by not being able to respond to each request, which finally saturates its power and skips the Error 504 Gateway Timeout.

A much more complete solution in this case is to move our site to the cloud where we find very economical options and with a large deployment of hardware resources.

We can see that, as the causes of this error are varied, so are the solutions, let us use each one according to our need and thus enjoy an ideal web connection.


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Mar 17, 2022 in Help by backtothefuture (550k points) | 181 views
+3 votes
1 answer
asked Oct 14, 2019 in Internet by backtothefuture (550k points) | 390 views
+5 votes
1 answer
asked Oct 15, 2019 in Linux / Unix by backtothefuture (550k points) | 253 views
+4 votes
1 answer
asked Jul 10, 2020 in Linux / Unix by backtothefuture (550k points) | 303 views
+3 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback
10,627 questions
10,759 answers
510 comments
3 users