Cloudflare 502 🟧 Cloudflare

Cloudflare-branded 502 Bad Gateway / 504 Gateway Timeout ("cloudflare" footer)

A plain-looking 502/504 page with “cloudflare” at the bottom comes from Cloudflare’s network itself (or an origin response it couldn’t use), not your server’s error page.

Seen on: Cloudflare

Meaning

If the page is Cloudflare-branded, either Cloudflare had a temporary problem, or your origin returned an invalid/empty response. If it’s your server’s own 502/504 page (nginx/Apache), the problem is behind Cloudflare (PHP-FPM, upstream app).

Common causes

  • Origin returning malformed/empty responses or resetting connections
  • Temporary Cloudflare edge issue (check status)
  • Origin firewall/rate limiting Cloudflare IPs intermittently

⚡ Quick fix

  1. Check cloudflarestatus.com
  2. Compare with a direct request to the origin
  3. Allowlist Cloudflare IP ranges on the origin firewall

Detailed fix by platform

Shell

  1. bash
    curl -sI https://example.com | grep -iE '^(HTTP|server|cf-ray)'
    curl -sI --resolve example.com:443:ORIGIN_IP https://example.com | head -1

How to diagnose

  1. Branding — Cloudflare page or your server’s?
  2. Origin — Direct request result
  3. Status — Cloudflare incident?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.