Fix the 504 Gateway Timeout error

A 504 Gateway Timeout error happens when your browser can’t load the website it’s trying to reach. The 504 Gateway Timeout error is temporary, however by following the steps provided below, you can see why it’s happening and take measures to avoid encountering it again going forward.

A. Check your CDN settings

If you are using a CDN, make sure an incorrect setting isn’t causing the 504 gateway timeout error by performing the following checks:

1. Log in to your CDN customer portal and review your DNS settings
2. Review which IP address is used on DNS entries to confirm they are pointed correctly

B. Check your CDN network

If you are using a CDN, such as Cloudflare, this error may be triggered by a network error on their end. To verify if your CDN is operational, follow these steps:

1. Find the URL for your CDN provider’s status page. This is often found in the footer section of their official website.
2. Enter the status page URL into your browser and navigate to the page.
3. On the status page, look for any indicators or updates that show the current performance and health of the CDN services. This may include live status reports, incident logs, or maintenance schedules.
4. Specifically, look for any reported outages or issues in the regions where your audience is located as this could be triggering the gateway error

C. Check your hosting account resource usage

This solution only applies if you are using a CDN (such as Cloudflare,, etc.)

1. Log in to your hosting control panel
2. Click on the Resource Usage button

3. Click on the Current Usage tab

4. Locate the CPU UsagePhysical Memory Usage and Faults graphs. If you see the usage going above the limit line, this means your hosting account is exhausting its server resources, and triggering the 504 error on your website.

5. Allow some time to pass in order for your resource usage to stabilize. Once resource usage has stabilized, reload your website and you will see it.
6. Review both the CPU Usage and Memory Usage to better understand them along with the action steps listed in each guide.

D. Increase PHP memory threshold

The 504 gateway timeout error can be triggered when your website has exhausted its PHP memory threshold. Follow the steps below to increase the threshold.

1. Open this guide: Manage PHP options

2. Locate the memory_limit dropdown

3. On the dropdown, select the highest threshold value available

4. Re-attempt to load your website

E. Check on a mobile data connection

1. On your mobile device, open the Settings app
2. Locate the Wi-Fi 📶 section and click on it
3. Toggle the WiFi switch to the ‘Off’ position to disable the WiFi connection
4. In the Settings app, locate and select Connections or Cellular/Mobile Data (the exact name may vary depending on your device)
3. Toggle the Mobile Data switch to the On position to activate the mobile data connection
4. Check the top of your device screen for a mobile data indicator (such as 4G, LTE, or 5G) to confirm that mobile data is active
5. Open a browser window on your mobile device
6. Load your website

F. Refresh your browser page

1. Locate the circular arrow icon near the address bar and click it
2. Press F5 or Ctrl + R on Windows, or Cmd + R on a Mac to refresh using keyboard shortcuts

G. Load your website in Incognito or Private mode

Google chrome:

1. Click the three-dot menu in the top right corner of your browser
2. Select New Incognito Window
3. Load your website from the Incognito window


1. Click File from the menu at the top of the screen
2. Select New Private Window
3. Load your website from the private window

Mozilla Firefox:

1. Click the three-line menu in the top right corner of your browser
2. Select New Private Window
3. Load your website from the private window

H. Disable firewall and/or anti-virus software

1. Open Control Panel on Windows or System Preferences on macOS. For antivirus, open the application.
2. Select Firewall & network protection on Windows or the Firewall tab on macOS. In antivirus, go to settings.
3. Turn off Windows Defender Firewall or Firewall on macOS. Choose to disable or turn off in the antivirus program.

I. Disable VPN connection

1. Look for the VPN icon in your device applications or menu bar
2. Click the icon to open your VPN application
3. Press the disconnect button within the app to disable your VPN connection