Cloudflare 502 Cloudflare Origin: Edge & web server OSI layer 7 · Application Last updated 14 Oct 2026

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.

Exact message you may see 502 Bad Gateway cloudflare504 Gateway Time-out cloudflarecloudflare 502cloudflare 504
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:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

1016 — Cloudflare Error 1016: Origin DNS error (Cloudflare)10161033 — Cloudflare Error 1033: Argo Tunnel error (Cloudflare Tunnel not connected) (Cloudflare)10331200 — Cloudflare Error 1200: Cache connection limit (Cloudflare)1200502 — HTTP 502 Bad Gateway (HTTP)502504 — HTTP 504 Gateway Timeout (HTTP)504520 — Cloudflare Error 520: Web Server Returned an Unknown Error (Cloudflare)520cloudflared Unable to reach the origin service — cloudflared: Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared (502) (Cloudflare)cloudflared Unable to…Possible SYN flooding on port 80. Sending cookies. — Networking: TCP: request_sock_TCP: Possible SYN flooding on port 80. Sending cookies. Check SNMP counters. (Networking)Possible SYN flooding…Cloudflar…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.