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 configured for your primary server. If you configure your failover servers but don't configure 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 on all primary origin servers and any servers that will become your failover.
  2. Attach a condition 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.

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 web interface.
  2. From the 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.
      NOTE

      Preview the VCL 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.

Was this guide helpful?

Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.