HTTP

HTTP 412 Precondition Failed vs 523 Origin Is Unreachable

HTTP 412 (Precondition Failed) is a 4xx Client Error response, while 523 (Origin Is Unreachable) is a 5xx Server Error response. 412 indicates that one or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false. In contrast, 523 means that cloudflare-specific. Cloudflare could not reach the origin server (DNS resolution failed or no route).

Description

One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

When You See It

When using conditional requests with ETags and the resource has changed.

How to Fix

Refresh the ETag/Last-Modified value and retry with updated preconditions.

Description

Cloudflare-specific. Cloudflare could not reach the origin server (DNS resolution failed or no route).

When You See It

When Cloudflare's DNS for the origin fails to resolve.

How to Fix

Verify DNS records in Cloudflare dashboard. Check origin server's IP address.

Key Differences

1.

412 is a 4xx Client Error response, while 523 is a 5xx Server Error response.

2.

HTTP 412: One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

3.

HTTP 523: Cloudflare-specific. Cloudflare could not reach the origin server (DNS resolution failed or no route).

4.

You encounter 412 when when using conditional requests with ETags and the resource has changed.

5.

You encounter 523 when when Cloudflare's DNS for the origin fails to resolve.

When to Use Which

For 412 (Precondition Failed): Refresh the ETag/Last-Modified value and retry with updated preconditions. For 523 (Origin Is Unreachable): Verify DNS records in Cloudflare dashboard. Check origin server's IP address.

Learn More