Google Compute Engine

Google Compute Engine (GCE) lets you create and run a virtual machine (VM) on the Google infrastructure. The VM can be used as an origin server with your Fastly service once you set up and configure your VM instance and link your instance to a Fastly service.

Set up and create your GCE instance

  1. Sign up for Google Compute Engine and start the basic set up. If you are already signed up and at your dashboard, click the Get started link in the Try Compute Engine area.
  2. Create or select a project to hold your origin's data.

    Google Compute Engine create project

  3. Click Create instance to set up your virtual machine. You can set up your instance using either Windows or Linux.

    Google Compute Engine create new instance

  4. Fill in the necessary fields and click Create.

    When making your firewall selection, select either Allow HTTPS traffic (port 443) or Allow HTTP traffic (port 80); you will use one of those ports when you create your new origin in your Fastly service. If you select HTTPS traffic, you need to configure the VM to respond on port 443 with a valid TLS certificate.

    Google Compute Engine VM instance

  5. Make note of the following informatin for when you create your new origin in your Fastly service:

    • the instance's IP address (located in the External IP column at the bottom of the page). You'll use this in the Address field when you create your new origin.
    • the zone you are using (located in the Zone column at the bottom of the page). You'll use this to guide your selection of an appropriate shielding location for your origin.

Create a new origin in your Fastly service for your GCE account

Link your GCE account to a Fastly service following the steps below.

  1. Log in to the Fastly application.
  2. Create a new service if you don't already have one set up.
  3. Select the appropriate service from the Service menu.
  4. Click the blue Configure button to the right of the service name.
  5. Click the Hosts pane from the list on the left.
  6. In the Backends area click the New button to create a new backend. The New Backend window appears.

    Google Compute Engine new backend

  7. Fill out the New Backend window as follows:

    • In the Address field, type the IP address of your server.
    • In the Port field, type 80 or 443. This should match the port that you selected in the GCE interface.
    • In the Name field, type the name of your server (for example, Google Compute Engine).
    • Leave the Health Check, Auto Load Balance, and Weight controls set to their default values.
    • From the Shielding menu, select an available interconnect location from the list of shielding locations. See our information on interconnect locations below for more details.
  8. Click the Create button. The server appears in the Backends area.

In this example no cache control headers are set so default TTL will be applied.

Interconnect locations

The following interconnects allow you to establish direct links with Google's edge network when you choose your shielding location. By selecting one of the locations listed below, you will be eligible to receive discounted pricing from Google CDN Interconnect for traffic traveling from Google Cloud Platform to Fastly's network. Most customers select interconnects closest to their origin.

Interconnects exist in the following locations within North America:

Interconnects outside of North America exist in:

Review our caveats of shielding and select an interconnect accordingly.

Create new domains for GCE to respond to

  1. Click Domains from the list on the left. The Domains controls appear.

    the Domains controls, without any domains in existence

  2. Click the New button in the Domains area. The New Domain window appears.

    new domain

  3. In the Domain Name field, type the name that users will type in their browsers to access your site.

  4. Click the Create button to create the new domain.

  5. Deploy the new origins by activating the new version of your service.

Test your results and create a CNAME record

You can now test your results. In the example above, it would be www.example.com.global-nossl.fastly.net. After you test and you're satisfied with the results, create a CNAME record for your domain (e.g., www.example.com) pointing to global-nossl.fastly.net.

Back to Top