Nov 27, 2025
Ariffud M.
11min Read
The 504 Gateway Timeout error happens when the main server can’t get a response from another server that it needs to complete a request.
Causes of a 504 error often point to issues with the upstream server, such as it being overloaded, malfunctioning, or simply down. These issues prevent the gateway server from successfully processing the user’s request, leading to the timeout.
These issues can range from temporary glitches to more complex server configurations. Therefore, fixing a 504 Gateway Timeout error may require checking different parts of your website, from simple client-side issues to deeper server problems.
Here are eleven methods to resolve a 504 Gateway Timeout error:
The eleven methods in our troubleshooting guide cover both simple browser fixes and server-related solutions. While these solutions work for most websites, we’ll also include specific steps for WordPress users.
Continue reading to learn how to do each method, starting with simple client-side checks and moving toward more advanced server-side solutions.
Refreshing the web page is often the first and simplest step in resolving a 504 Gateway Timeout error. This action can fix temporary connectivity issues, especially if the error is due to a momentary glitch or server overload.
Make sure to clear your browser’s cache and web cookies before refreshing to solve potential underlying issues. To refresh the page, click the Reload button in your browser. Alternatively, you can use keyboard shortcuts. Press CTRL+R on Windows or COMMAND+R if you’re using macOS.
Do note that refreshing web pages won’t solve the error if the server is still experiencing ongoing issues. In such cases, further troubleshooting of 504 Gateway Timeout methods is necessary.
Switching to a different web browser can help determine whether a 504 Gateway Timeout error is specific to the browser you’re using. Issues such as outdated software, third-party extensions, or a corrupted browser cache can cause such an error.
Try opening another web browser on your device and accessing the same web page. Alternatively, use incognito mode in your current browser.
If the web page loads successfully, the issue may lie with your primary browser’s cache, extensions, or settings.
In case the page still doesn’t load, it could indicate a more widespread issue, possibly on the server-side. You can check if the website is down for others by using an online service like Website Planet or Site24x7.
A proxy server sits between your device and the internet, offering privacy benefits like hiding your device’s location or encrypting web requests. Incorrect proxy settings may hinder proper communication with web servers, though that scenario is uncommon.
Here’s how to check your computer’s proxy settings:


The steps are similar for other recent macOS versions, just with “System Preferences” instead of “System Settings” for pre-Ventura.
Although some computers and networks don’t use proxy services by default, web browsers may have separate proxy configuration settings. Therefore, it’s advisable to check that as well.
Important! Remember that altering your network settings can impact your entire internet access, causing potential problems of its own. Pay close attention when making any changes to your network settings.
A firewall is an essential tool to safeguard your computer against unauthorized access and various cyber threats. However, a faulty firewall configuration may mistakenly prevent legitimate network requests, leading to the 504 Gateway Timeout error.
Follow these steps to turn off your firewall temporarily:


After turning off the firewall, try reaccessing the website to determine if faulty firewall settings were contributing to the 504 error.
Important! Deactivating your firewall should be a temporary troubleshooting step. It is generally not recommended to leave your firewall disabled, as this can significantly increase the vulnerability of your system.
Flushing the DNS cache can be effective in resolving network connectivity issues, such as 504 Gateway Timeout errors. This process clears outdated or corrupted DNS information that might prevent your device from connecting to websites.
To fix client-side DNS issues, try flushing your DNS cache in your operating system:

Google Chrome maintains a separate DNS cache. To clear it:

If your website has recently moved to a different IP address or server, you might need to wait up to 48 hours for the DNS propagation process to complete since ISPs need to update their records.
Use tools like whatsmydns.net to verify whether the propagation is complete.
For persistent DNS issues, switch to a public DNS service like Google Public DNS, Cloudflare 1.1.1.1, or Quad9 for faster and more reliable DNS resolution.
One of the causes of the 504 Gateway Timeout can be code corruption from recent updates or third-party plugins. Checking the website’s error log may help identify this problem. Error logs record various issues that occur on your site, including those leading to a 504 error code.
Hostinger’s web hosting customers can utilize the PHP error logging feature through the hPanel. Here’s how:


If your hosting provider doesn’t offer PHP error logging by default and you use WordPress, you can enable the debug mode on your site by following these steps:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );

Here are the explanations of each variable:
After changing these settings, you can access raw WordPress error log files via SFTP. They are usually located in the server’s root directory under the logs folder.
Furthermore, checking the server log files is also helpful for troubleshooting. Here are some typical locations for server logs, depending on the web server used:
In rare cases, WordPress plugins can sometimes lead to a 504 Gateway Timeout error. This issue arises due to plugin-related server workload increases or compatibility issues.
Here’s how to check the website’s plugin for a 504 timeout error recovery:

If you can’t access your WordPress dashboard, use your web host account’s File Manager or an FTP client. Then, navigate to the wp-content directory and rename the plugins folder. This will disable all plugins, allowing you to test if the WordPress website works without them.

After confirming a plugin issue, restore the original folder name to plugins and deactivate each plugin individually to pinpoint the problematic one.
If disabling WordPress plugins doesn’t resolve this issue, the problem might be with your WordPress theme. Switch to a default theme via your dashboard to see if this addresses the problem.
A content delivery network (CDN) boosts website performance by speeding up content delivery and offering DDoS mitigation. However, it can sometimes cause a 504 Gateway Timeout error as well.
Temporarily disabling your site’s CDN can help diagnose 504 issues. Hostinger customers who have Business plans or above can deactivate the built-in CDN like this:

If disabling the CDN allows website access, keep the CDN disabled temporarily. Contact our support team for assistance in resolving this CDN-related problem.
If you’re using a CDN service other than Hostinger’s, first check their system status for any reported issues. You can deactivate most CDN services by logging into your provider’s interface and finding an option to Pause or Deactivate the CDN.
Remember that disabling CDN services may involve DNS changes, which require time to propagate fully. After the DNS propagation finishes, revisit your website to check if the 504 error persists.
If you encounter a 504 error, check your server resources, as server overload is a common cause. Hosting providers allocate specific resources for optimal website performance, but sometimes errors occur.
Hostinger users can check their allocated resources by navigating to Hosting Plan → Resources Usage on hPanel. Pay attention to CPU Usage and RAM Usage. High values suggest an overloaded server struggling with heavy traffic.

When you notice high resource usage, reduce your site’s traffic load or optimize performance. If your WordPress site has already reached its hosting limits, consider upgrading your plan.
Server timeouts may happen if PHP scripts exceed the server’s set execution time. Extending the maximum execution time limit can prevent such timeouts.
If you use Hostinger, you can increase the WordPress maximum execution time value via hPanel:

Important! Avoid setting the max-execution-time value to 0, as this allows PHP scripts to run indefinitely, potentially consuming excessive server resources as a result.
You can also increase the maximum execution time by editing your WordPress site’s .htaccess file. Here’s an example snippet to add to the file:
php_value max_execution_time 60
Adjust the number as needed for your WordPress site.

For websites on VPS hosting, adjusting Apache and NGINX settings can manage server timeouts and resolve 504 errors. Here’s how to change settings on both Apache and NGINX servers:
Timeout 600
max_execution_time = 300
sudo service apache2 restart.
proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; fastcgi_read_timeout 300;
sudo service nginx reload
sudo service php[version]-fpm reload && sudo service nginx reload
When you’ve tried all other methods and still face a 504 Gateway Timeout error, it is best to reach out to your hosting provider’s customer support for help.
When contacting support, be as detailed as possible about your issue. Include your website URL, the gateway message you’ve encountered, and a summary of the steps you’ve already taken to try to resolve the issue.
Hostinger users can quickly get help from Kodee, our AI Assistant, by clicking the Ask Kodee button in the bottom-right corner of hPanel. Just type your concern into the chat and let us know which website is experiencing the error, and Kodee will instantly help troubleshoot the issue.

If you need further assistance, Hostinger’s Customer Success team is also available 24/7.
The 504 Gateway Timeout error happens when a server takes too long to respond, stopping a web page from loading. Some common triggers include:
To prevent 504 Gateway Timeout errors, ensure you regularly monitor server loads and optimize website resources. Proactive server maintenance and efficient content delivery can reduce the chances of encountering this web server timeout error.
The 504 Gateway Timeout error can manifest in several different forms depending on the web browser, server configuration, and operating system.

These are some common 504 error variations you might encounter:
504 Gateway Timeout errors can negatively impact a site’s search engine optimization (SEO) if they occur frequently or persist for an extended period. It’s because search engines like Google use HTTP status codes to assess the health and accessibility of a website.
If a website regularly returns a 504 status, search engines might perceive it as unreliable, potentially leading to a lower ranking in search engine results. To minimize SEO damage during downtimes caused by 504 errors, consider implementing these tips:
Apart from the 504 Gateway Timeout, other common errors within the 500 range include 502 Bad Gateway and 503 Service Unavailable. Each gateway timeout response represents different server-side issues in handling requests, requiring specific troubleshooting approaches for resolution.
The 504 Gateway Timeout error shares some similarities with the 502 Bad Gateway error, as both indicate issues with server communication. The key difference is that a 504 error happens when there’s a delay in the server’s response, while a 502 error occurs when a server gets an invalid response from another server.
It’s crucial to fix any error messages quickly to keep your site running smoothly and protect your SEO. Check out our guide on the complete list of HTTP status codes to help you stay ahead of problems. Alternatively, you can download the cheat sheet below for quick reference.
Download comprehensive HTTP status codes cheat sheet
All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.