req.backend.is_origin

BOOL, read-only.

Available inpassmissfetch

True if this backend, or recursively any of the backends under this director, is not a shield backend. False otherwise.

Try it out

req.backend.is_origin is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See the full list of code examples for more inspiration.

Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Follow redirects at the edge

Protect clients from redirects by chasing them internally at the edge, and then return the eventual non-redirect response.

Failover to a secondary backend

If primary backend fails, retry with a different backend without caching the failure or reducing cache efficiency.