Multiple origins & failover
On Pro and Business plans, a property can have multiple origins with a priority order. The edge always fetches from the highest-priority enabled origin; if that origin fails, it automatically retries the next one — so a dying backend doesn't take your site down. See Plans & pricing.
How failover works
Origins are tried in priority order (1 first). Each request goes to the highest-priority enabled origin that is not marked down, and gets one fallback: the next healthy origin after it. The edge moves on to the fallback when the first origin:
- Does not answer — connection refused, connect/read timeout, or a TLS failure. The edge gives an origin 5 seconds to accept the connection and complete the TLS handshake, and 55 seconds to start answering (30 seconds when it fetches an image to optimize it).
- Returns
502,503or504.
Every other response is served as-is, a 500 included, and so is any 4xx — a 404 or 403 is a valid answer from a healthy origin. When the edge fetches an image to optimize it, only an origin that does not answer or returns 502 or 504 moves it to the fallback; a 503 is served as-is.
The retry happens within the same request — the visitor gets the fallback's response, a little later because of the failed attempt. A request never goes on to a third origin: if the fallback fails too, the visitor gets the error, or the stale copy if Always Online covers it.
An origin that fails is marked down for 30 seconds, so the requests that follow start at the next healthy origin without paying for the failed attempt. A failed fetch of an image to optimize moves on to the fallback but does not mark the origin down. When the 30 seconds are up the origin is tried again, so traffic returns to it as soon as it recovers; there is nothing to reset.
If Always Online covers the failure and the edge holds an expired copy of the URL, a failure that comes more than 6 seconds into the request — a read timeout always does — serves that copy instead of trying the fallback (25 seconds when the edge fetches an image to optimize it). A faster failure still goes to the fallback first.
Adding origins
- Open your property and go to the General tab.
- In the Origin Server card, click Add origin and enter the host — the same forms as the first origin are accepted, see Allowed origins.
- Set the origin's priority — 1 is tried first. Reorder origins at any time; the order is the failover order.
- Each origin has its own Host Header override and SSL verify toggle, and can be enabled or disabled individually — a disabled origin is skipped entirely, which is handy for taking a backend out of rotation during maintenance.
- Save the card.
Failover assumes every origin can answer any request for the property. Point the origins at replicas of the same site — not at different applications — or visitors will see inconsistent content whenever a failover occurs.
If the property has an Origin Shield enabled, failover between your origins happens on the shield, which is what contacts them, with the same rules. The edge keeps talking to the shield; if the shield does not answer or returns 502 or 504, the edge retries the highest-priority origin directly.
Related
- Origin server and Host header — the origin fields and how to edit them.
- Allowed origins — accepted host forms.
- Always Online — serve stale content when the origins fail.