---
title: Failover configuration
summary: null
url: >-
  https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/failover-configuration
---

This guide describes how to configure failover origin servers. Failover (backup) servers ensure you can maintain availability of your content if your primary server is not available.

## Before you begin

To configure failover origin servers you must make sure you have [health checks](https://www.fastly.com/documentation/guides/getting-started/hosts/working-with-health-checks) configured for your primary server. If you configure your failover servers but don't configure [health checks](https://www.fastly.com/documentation/guides/getting-started/hosts/working-with-health-checks) on the primary server, the failover won't work properly if your primary server stops responding.

## Configuring a failover origin server

Once you've confirmed health checks are configured, you must:

1. [Enable automatic load balancing](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/failover-configuration#enable-automatic-load-balancing) on all primary origin servers and any servers that will become your failover.
2. [Attach a condition](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/failover-configuration#specify-when-to-use-the-failover-server) to the failover server that specifies exactly when to use is as a backup.

### Enable automatic load balancing

To configure a failover origin server, turn on automatic load balancing for your primary and failover origin servers by following the steps in our guide on [configuring load balancing](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/automatic-load-balancing#enabling-load-balancing).

### Specify when to use the failover server

Once you've configured your primary and failover servers, attach a condition that specifies exactly when the failover servers should be used. The settings for the condition differ depending on whether you have a single primary origin server or multiple primary origin servers.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

3.   Click **Edit configuration** and then select the option to clone the active version.

4.   Click **Origins**.

5. In the **Hosts** area, find your failover origin server and click **Attach a condition**.

6. Click **Create a new request condition**.

7. In the **Name** field, enter the name of your request condition (for example, `Primary origin down`).

8. In the **Apply if** field, enter the conditions under which to use the failover server:

   - If you have multiple primary servers, enter the following in the **Apply if** field: `backend.autodirector_.healthy == false`.
   - If you have a single primary server, enter the following in the **Apply if** field: `backend.{name of primary server}.healthy == false`.

     > **HINT:** [Preview the VCL](https://www.fastly.com/documentation/guides/full-site-delivery/fastly-vcl/working-with-custom-vcl#previewing-vcl-before-activation) to find the name of the primary server. Typically the name is prefixed with `F_` and spaces are replaced with underscores. For example, a backend called `Host 1` has the VCL name `F_Host_1`.

9. Click **Save and apply**.

10. For any other failover origin servers, click **Attach a condition** and select the condition you already created to apply it.

## Related content

- [Redundancy and failover](https://www.fastly.com/documentation/guides/concepts/failover/)
- [Health checks](https://www.fastly.com/documentation/guides/concepts/healthcheck/)
