Skip to main content
HTTP/5xx (Server Error)

523 Origin Is Unreachable

Cloudflare-specific: Cloudflare could not reach the origin server at all.

❓ Why does this happen?

Incorrect DNS records or routing issues between Cloudflare and the origin network.

✅ How to fix it

Fix the origin IP in Cloudflare DNS settings and test with: curl -v --resolve example.com:443:ORIGIN_IP https://example.com

Return or handle 523 in your stack

// Note: 523 is normally generated by Cloudflare, not your app.
// Emitting it yourself is only useful for testing client error handling.
// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Origin Is Unreachable", status: 523 },
    {
      status: 523
    }
  );
}

Live 523 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 523 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/523

Frequently Asked Questions

What does HTTP Status 523 mean?
Cloudflare-specific: Cloudflare could not reach the origin server at all.
Why am I getting a 523 status code?
Incorrect DNS records or routing issues between Cloudflare and the origin network.
How do I fix a 523 Origin Is Unreachable error?
Fix the origin IP in Cloudflare DNS settings and test with: curl -v --resolve example.com:443:ORIGIN_IP https://example.com
How can I test how my app handles a 523 response?
Send a request to https://castov.com/api/mock/523 — it returns a real 523 Origin Is Unreachable response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 5xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.