---
description: Learn how to configure Fastly CDN for use with Filebase.
---

# Fastly CDN

## What is Fastly CDN?

Fastly CDN is a Content Delivery Network provider.

A Content Delivery Network is a network of servers across a diverse selection of geographic locations that help improve the speed and quality of content delivery. CDNs allow for quick transfers of content types such as HTML web pages, images, videos, spreadsheets, and JavaScript applications. CDNs can also help mitigate and protect websites against Distributed Denial of Service attacks (DDoS).

Learn how to connect your Filebase bucket to Fastly CDN to increase file delivery speeds to and from your bucket.

{% hint style="success" %}
### Prerequisites:

* [x] Have a Fastly CDN account. You can create one [here.](https://manage.fastly.com/services/all)
* [x] [Sign up](https://filebase.com/signup) for a free Filebase account.&#x20;
* [x] Have your Filebase Access and Secret Keys. Learn how to view your access keys [here](https://docs.filebase.com/getting-started-guides/getting-started-guide#working-with-access-keys).
* [x] Create a Filebase Bucket. Learn how to create a bucket [here](https://docs.filebase.com/getting-started-guides/getting-started-guide#creating-and-working-with-buckets).
* [x] **Your Filebase bucket must be public.** Learn how to make your bucket public [here](https://docs.filebase.com/getting-started-guide#making-a-bucket-public-or-private).
{% endhint %}

### 1. Login to the [Fastly CDN dashboard](https://manage.fastly.com/services/all). Select ‘Create a Delivery service’.

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FomuVveJCALi6sqiwZEi9%2Fimage.png?alt=media\&token=0f3945b8-e4ec-4e15-aeda-59793d1d47b4)

### 2. In the delivery service creation screen, enter your domain name under the ‘Domains’ tabs.



Click ‘Add’.

### 3. Select ‘Hosts’ on the left side menu under ‘Origins’. Enter the public URL of your Filebase bucket.

This URL will be in the format:

```xml
bucket-name.s3.filebase.com
```

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FRl8XeDEhmwFtrqGB7VxF%2Fimage.png?alt=media\&token=bf1adcaf-e7dc-4262-8265-21179edcdfd4)

Click ‘Add’.

### 4. Once your host has been added, it will be listed below. Click the Pencil icon next to the host name to edit the settings of the host.

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FtjHeFFNOtSjtzqoNihMV%2Fimage.png?alt=media\&token=32179d4a-c5a8-4d5c-8e74-ff842cd0de2b)

### 5. Configure the following settings:

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FZtf0PVdQs4aoy9MXK7IM%2Fimage.png?alt=media\&token=a6f29fa5-2150-459b-bd0a-1c33698efe32)

**Enable TLS:** Yes, enable TLS and connect securely using port 443

**Verify Certificate:** Yes, verify the authenticity of the TLS certificate.

**SNI hostname:** Match the SNI hostname to the Certificate hostname. This value identifies which certificate should be used for the request to origin.

### 6. Select ‘Advanced TLS options’. Configure the following:

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FCpmwJhMTCoSfaloXm207%2Fimage.png?alt=media\&token=66c02902-8bb7-42f1-949a-fbc2436bb91c)

### 7. Select ‘Advanced Options’ at the bottom.

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2F2OSHjWdlYlZ4rigxkPcH%2Fimage.png?alt=media\&token=6ba02f23-d873-46b0-8c19-0c895b76850d)

### 8. In the advanced options, set the following configuration:

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FFJ4qSJ9FLiazF3MRjRer%2Fimage.png?alt=media\&token=bbb5f57a-3d46-43fc-98c9-e224b895f826)

**Override host:** Enter the public URL of your Filebase bucket. This URL will be in the format:

```xml
bucket-name.s3.filebase.com
```

{% hint style="danger" %}
This step is very important. This configuration will not work otherwise this override host setting is configured.
{% endhint %}

### 9. Activate the configuration.

Do so by selecting ‘Domains’ in the left side menu again, then selecting ‘Activate’ in the upper right corner.

![](https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FNGNYcCa4zKU8A8wtFC2M%2Fimage.png?alt=media\&token=b331fcb1-7c1f-4d4c-9a93-e295894ecd35)

### 10. Test your configuration. You can test this without adding any CNAME records for your domain name by going to:

```xml
yourwebsite.com.global.prod.fastly.net/filename
```

where [yourwebsite.com](http://yourwebsite.com) is your domain name, and filename is a file in your Filebase bucket.
