Home › Knowledgebase › KB-1213

How to fix 504 gateway timeout error

Summary

This guide helps you troubleshoot and resolve: How to fix 504 gateway timeout error. Follow the steps below to fix the issue.

Quick Tip: Need immediate assistance? 💻 Open a Ticket

Common Causes

A 504 Gateway Timeout error means that a server acting as a gateway or proxy did not receive a timely response from an upstream server. In most cases, this indicates that your website is experiencing high traffic, a backend process is hanging, or server resources have been exhausted. This guide explains how to identify whether the issue originates from your hosting environment, a third-party integration, or a DNS misconfiguration, and outlines the steps to restore availability.

Remember — If you host with us, you don't need to do this yourself — just Open a Ticket and our team will get it sorted.

Quick Fix Steps

  1. Refresh your browser page to see if the error clears.
  2. Clear your browser cache and cookies.
  3. Try accessing your website from a different network or mobile device.
  4. Check if other websites on the same hosting account are also affected.

Detailed Instructions

1. Check Server Resources

A 504 error often occurs when your server has run out of memory or CPU capacity, causing upstream processes to time out before they can respond.

  1. Log in to your hosting control panel (such as cPanel, Plesk, or your provider's custom dashboard).
  2. Navigate to the Resource Usage, CPU and Concurrent Connection Usage, or Statistics section.
  3. Review the graphs for CPU, memory, and entry processes.
  4. If you see sustained spikes at or near 100%, your plan may be underpowered for your current traffic.
  5. Consider upgrading your hosting plan or optimising your website to reduce resource consumption.
On shared hosting, resource throttling is common during traffic peaks. If your site regularly hits limits, moving to a VPS or dedicated environment may provide more consistent performance.

2. Review Third-Party Integrations and Plugins

Slow or hanging API calls to external services can cause your server to wait too long for a response, triggering a 504 error.

  1. Log in to your website's administration area (for example, WordPress wp-admin).
  2. Go to Plugins > Installed Plugins.
  3. Deactivate any recently installed or updated plugins, especially those that connect to external APIs, payment gateways, or shipping calculators.
  4. Refresh your website to check if the error disappears.
  5. Reactivate plugins one at a time to identify the problematic integration.
Always create a full website backup before deactivating or removing plugins, particularly on live production sites.

3. Increase Server Timeout Settings

If your backend scripts take longer than the default limit to execute, the gateway may close the connection prematurely.

  1. Access your server via FTP or your hosting control panel's File Manager.
  2. Locate your .htaccess file (Apache) or nginx.conf file (Nginx).
  3. For Apache, add or modify the following directive in .htaccess:
ProxyTimeout 300
  1. For Nginx, add or adjust these values within the http, server, or location block:
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
  1. Save the file and restart your web server if you have access to do so.
  2. Test your website again.
Increasing timeouts can mask underlying performance issues. If scripts consistently require long execution times, investigate database queries or inefficient code rather than simply extending limits.

4. Check DNS Configuration

Incorrect DNS records can point visitors to the wrong server or an unresponsive IP address, resulting in gateway timeouts.

  1. Log in to your domain registrar's control panel or your DNS hosting provider.
  2. Locate the DNS Management, Zone Editor, or Manage DNS section.
  3. Verify that your domain's A record points to the correct IP address of your web server.
  4. Check that any CNAME records for www or subdomains resolve correctly.
  5. Use a DNS lookup tool to confirm propagation across Australian and international servers.
DNS changes can take up to 24–48 hours to propagate globally, though updates are often visible within a few hours.

Troubleshooting

Geographical Latency for Domestic Traffic

If your server is hosted overseas, Australian visitors may experience higher latency, increasing the likelihood of timeouts during resource-intensive operations.

Slow Load Times and Unreliability

Intermittent 504 errors often signal that your hosting environment has been outgrown.

When to Escalate

If you have completed the steps above and the 504 error continues, the issue may be with your hosting provider's infrastructure or a misconfigured upstream server that is outside your control.

Remember — If you host with us, you don't need to do this yourself — just Open a Ticket and our team will get it sorted.

Still Having Issues?

Need more help? If the issue persists after trying these steps, please open a support ticket and our team will assist you.

💻 Open a Ticket