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 the Edit configuration button and then select the option to clone the active version. The Domains page appears.
  4. Click the Origins link. The Origins page appears.
  5. In the Hosts area, find your failover origin server and click the Attach a condition link. The Add a condition window appears.
  6. Click Create a new request condition. The Create a new request condition window appears.
  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.
  9. Click Save and apply.
  10. For any other failover origin servers, click the Attach a condition link and select the condition you already created to apply it.
Back to Top