Initial impact: 503 for visitors, 200 for you
curl -I http://localhost or hit the origin IP directly, and get a clean 200 OK. You check process lists, disk space, load average, all normal. The confusion comes from assuming that if the origin works, Cloudflare should too.
But a request through Cloudflare passes through at least two layers before reaching your server: the edge PoP (Point of Presence, the Cloudflare data center closest to the visitor) and the origin pull (Cloudflare connecting back to your server). If you use Cloudflare Workers, there is a third layer. A 503 can originate at any of these points, and the error page itself plus the response headers tell you which one.
First check: who generated the 503 page?
BASH
curl -sD - https://example.com | head -50server response header and the HTML body. A server: cloudflare header combined with Cloudflare-branded error HTML means the edge or the origin pull failed. A server: cloudflare header but with your origin's error page (Apache's default 503, Nginx's own error template, or your custom error page) means the origin returned 503 and Cloudflare relayed it.
Reading cf-ray to identify the edge PoP
cf-ray header. It looks something like this:
TEXT
cf-ray: 8a1b2c3d4e5f6-SINSIN means Singapore, LAX means Los Angeles, CGK means Jakarta.
Why this matters during a 503 investigation:
- If all failing requests share the same PoP code, the problem might be isolated to that specific edge location or the network path between that PoP and your origin. Cloudflare has had incidents where individual PoPs experienced issues while the rest of the network was fine.
- If failing requests come from multiple different PoPs, the problem is almost certainly on the origin side or in a Worker that runs globally.
- The
cf-rayvalue is what Cloudflare support needs if you open a ticket. Without it, they cannot trace the request through their systems.
cf-ray values from different geographic locations (ask a colleague in another region, or use a tool that lets you specify the request origin) and compare the PoP codes.
Reading cf-cache-status to understand the request path
cf-cache-status header tells you what Cloudflare's cache layer did with the request. During a 503 investigation, this header reveals whether Cloudflare even attempted to reach your origin.
Common values you will see:
| Value | What it means for your investigation |
|---|---|
DYNAMIC | Request was not cacheable. Cloudflare forwarded it to origin. If you got a 503 with this status, the origin pull failed or origin returned 503. |
MISS | Cacheable but not in cache. Cloudflare went to origin. Same implication as DYNAMIC for a 503. |
HIT | Served from cache. You should NOT see a 503 with a HIT, because cached content would be served. If you do, something unusual is happening. |
BYPASS | Cache was deliberately skipped (by a Page Rule, Cache Rule, or Worker). Cloudflare went to origin. |
EXPIRED | Cache entry existed but expired. Cloudflare went to origin for a fresh copy. |
cf-cache-status: DYNAMIC or MISS, Cloudflare tried to reach your origin and either could not connect or received a 503 back. This narrows the investigation to the origin pull path.
The critical discovery: origin firewall blocking Cloudflare IPs
BASH
grep -i deny /var/log/lfd.log | head -20CF-Connecting-IP or X-Forwarded-For header) rather than Cloudflare's edge IP. Otherwise, all visitors behind a single PoP look like one client, and legitimate traffic triggers the rate limit. For more on rate limiting configuration, see Rate Limiting xmlrpc.php to Prevent Recurring Server Load Spikes, which covers how to set up rate limits that work correctly behind a reverse proxy.
Other fault layers: Workers and origin pull timeouts
/wp-admin/admin-ajax.php is responding within acceptable time.
Temporary mitigation
- If the problem is firewall-related, flush the blocked IPs and whitelist Cloudflare ranges immediately.
- If a Worker is suspect, disable it or add a try/catch that returns a meaningful error instead of crashing.
- If the origin is slow on specific paths, enable Cloudflare's "Always Online" feature (if available on your plan) to serve stale cached copies while you fix the origin. This only helps for previously cached pages.
- Use "Development Mode" in Cloudflare to bypass caching entirely, which does not fix a firewall block but helps isolate cache-related issues.
The architectural fix
mod_remoteip, Nginx has set_real_ip_from, and LiteSpeed has its own trusted proxy configuration.
Monitor the origin pull path, not just the origin itself. A health check that curls localhost proves the process is running. It does not prove that Cloudflare can reach port 443 on your public IP through your firewall. Set up an external monitor that hits the URL through Cloudflare and alerts on non-200 responses.
Log cf-ray on the origin. Add $http_cf_ray (Nginx) or the equivalent to your access log format. When a user reports a 503 and gives you the cf-ray value, you can check whether that request ever reached your origin. If it is absent from origin logs, the connection died between Cloudflare and your server.
The headers Cloudflare attaches to every response are not decorative. cf-ray tells you where, cf-cache-status tells you how the request was handled, and the error page branding tells you who generated the error. Check all three before assuming the problem is on Cloudflare's side or yours. Most of the time, the origin is not as healthy as it looks from the inside.