Gateway time-out Error code 504 or 502

Hi there,

Error codes 504 and 502 indicate that your server is not responding appropriately to Cloudflare requests. To fix this problem, follow these steps:

  • Check your server’s health to ensure it’s operational and not overcrowded.
  • Check server logs to find any issues or timeouts.
  • Make sure your server’s firewall isn’t blocking Cloudflare IP addresses.
  • If additional server resources are required to accommodate traffic, increase them.
  • If the problem persists, try temporarily stopping Cloudflare (setting DNS records to grey cloud) to see if the problem is with Cloudflare or your server.

For further information, see Cloudflare’s Community Tip on correcting 502/504 problems here.