Diagnostics

Craft Cloud’s gateway adds a handful of headers to help narrow down the source of a failed request.

#Response Headers

Headers are set in one of three places:

  • cf-*: Cloudflare
  • x-gateway-*: Craft Cloud gateway
  • All others: Origin (typically your Craft application, or a rewritten origin)
Response Header Description
x-gateway-flow How Craft Cloud produced the response. For example, /origin/fetch reached Craft.
x-gateway-http-signature Request-signing result. verified succeeded; unverified if a signature was detected but it failed validation.
cf-ray Cloudflare request ID.1
cf-cache-status Cloudflare cache status.1
x-gateway-cf-ray Cloudflare request ID.2
x-gateway-cf-cache-status Cloudflare cache status.2

1 With Cloudflare O2O (opens new window) requests, the marked headers describe the customer zone.

2 The marked headers describe the Craft Cloud zone and are only present with Cloudflare O2O (opens new window) requests.

#Interpreting Failures

Status codes may be shared between layers in the response stack. Combined with diagnostic headers, you can narrow down the source:

Status Response Headers Interpretation
4xx/5xx x-gateway-flow: /origin/fetch Returned by Craft; check your application logs.
400/403/413 x-gateway-flow: /origin/reject Detected invalid or malicious request.
401 x-gateway-http-signature: unverified The signature was invalid or expired.
404 x-gateway-flow: / Hostname did not match a Craft Cloud environment.
429/503 Retry-After: <date/seconds> Automate retry, honoring Retry-After.
500/502 No x-gateway-flow: /origin/fetch A gateway error occurred; contact support if it persists.
504 x-gateway-flow: /origin/fetch/error The origin exceeded the request duration limit.
5xx No x-gateway-flow The error occurred before the gateway, either in the craft.cloud zone or a parent Cloudflare zone.