Health Checks tutorial

In this tutorial we will show you how to create health checks that will periodically contact your origin servers to make sure they are still working.

We will assume that you are already accustomed to editing and deploying configurations using the web-based configuration application. If you are not familiar with basic editing using the application, please see our Help Guides to learn more before moving forward.


Health checks, while simple in principle, are a little more involved than most other configuration objects. Let's run through the options you have when creating a health check so you have a place to start when working through the tutorial.

Fastly will periodically check your origin server based on the options chosen. Pay special attention to the HTTP host header. A common mistake is setting the wrong host. If the origin server does not receive a host it expects, it may issue a 301 or 302 redirect causing the health check to fail. Also, Varnish requires the origin server receiving the health check requests to close the connection for each request. If the origin server does not close the connection, health checks will time out and fail.

If an origin server is marked unhealthy due to health checks, Fastly will stop attempting to send requests to it. If all origin servers are marked unhealthy, Fastly will attempt to serve stale. If no stale object is available, a 503 will be returned to the client.

Creating a Health Check

  1. Log in to the Fastly application and click the configure tab (wrench icon).

    the configure tab

  2. From the Service menu, select the appropriate service and then click the blue Configure button. The main controls for your selected service appear.

  3. Click Hosts from the section list on the left. The Hosts window appears.

    the New Health Check button

  4. In the Health Checks area at the bottom of the page, click the green New button. The New Health Check window appears.


  5. Fill out the fields in the New Health Check window. For more information, review the field descriptions in the Overview section.

  6. Click the Create button to create the health check.

Your new health check will now appear in the list of checks.

Assigning a Health Check

Health checks do nothing on their own, but they can be added as a special parameter to an origin server in your configuration.

  1. Edit one of your existing origin servers by clicking the gear to the right of the origin server's name, and then selecting the Edit option.

    the Backends section

  2. From the Health Check menu, select the health check you just created.

    Editing an origin server via the Edit window

  3. Click Update.

Fastly will now use the health check to monitor the selected origin server.

Back to Top