> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage as a CDN origin

> Use Gcore Object Storage or SFTP Storage as a CDN origin, with public and private bucket connection modes and no egress billing.

Object Storage and SFTP Storage can serve as origins for Gcore CDN resources, delivering content from storage through the CDN network.

## CDN origin configuration

Both storage types connect as CDN origins through the same resource creation wizard, with origin configuration varying by storage type.

### Object Storage

Two connection modes are available depending on whether the bucket is public or requires authentication. Egress from Gcore Object Storage to the CDN is not billed.

**1. Open CDN resources**

Navigate to the [CDN](https://portal.gcore.com/cdn/resources/list) section and click **Create CDN resource**.

![CDN resources list with the Create CDN resource button](https://mintcdn.com/gcore/bP_M3iNvkCNJWoX1/images/docs/storage/use-storage-as-the-origin-for-your-cdn-resource/create-cdn-resource-10.png?fit=max\&auto=format\&n=bP_M3iNvkCNJWoX1\&q=85\&s=78cb26c5a95839477ecc3c83395b36f3)

**2. Configure the origin source**

In the **Origin** section, **Specify content origin** is selected by default. Choose a connection type based on bucket visibility:

* **Public bucket** (anonymous access allowed): In the **URL** tab, enter the bucket hostname in the **Origin source** field: `<bucket-name>.luxembourg-2.storage.gcore.dev`.
  * **Private bucket** (authentication required): Select the **S3 storage** tab. Select **Gcore**, then choose a **Storage** and **Bucket**. Access keys are not entered. **Create storage** and **Create bucket** are available in those lists. Only Standard storage is supported.

![CDN resource creation form with URL tab and Origin source field](https://mintcdn.com/gcore/bP_M3iNvkCNJWoX1/images/docs/storage/use-storage-as-the-origin-for-your-cdn-resource/image3527.png?fit=max\&auto=format\&n=bP_M3iNvkCNJWoX1\&q=85\&s=4eba76288cf5d41f37c960f4d50ea65f)

**3. (Optional) Add a custom domain**

Specify a custom domain — the [setup guide](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) covers required DNS changes.

### SFTP Storage

SFTP Storage connects as a CDN origin using a URL-based hostname, without bucket authentication options.

**1. Open CDN resources**

Navigate to CDN resources and click **Create CDN resource**.

![CDN resources list with the Create CDN resource button](https://mintcdn.com/gcore/bP_M3iNvkCNJWoX1/images/docs/storage/use-storage-as-the-origin-for-your-cdn-resource/create-cdn-resource-10.png?fit=max\&auto=format\&n=bP_M3iNvkCNJWoX1\&q=85\&s=78cb26c5a95839477ecc3c83395b36f3)

**2. Configure the origin source**

In the **Origin** section, select the **URL** tab and enter the origin source in the **Origin source** field using the format `<storage-name>.<hostname>`.

The storage name and hostname are available in **Object Storage** > **Object Storages** — open the three-dot actions menu for the storage and select **Details**.

![Storage details panel showing the storage name and hostname fields](https://mintcdn.com/gcore/bP_M3iNvkCNJWoX1/images/docs/storage/use-storage-as-the-origin-for-your-cdn-resource/use-sftp-as-origin-40.png?fit=max\&auto=format\&n=bP_M3iNvkCNJWoX1\&q=85\&s=bbe1c3dca21917d3ea52e042a12eb35c)

If the storage name is `12345-test` and the hostname is `ams.origin.gcdn.co`, enter `12345-test.ams.origin.gcdn.co` in the **Origin source** field.

**3. (Optional) Add a custom domain**

Specify a custom domain — the setup guide covers required DNS changes.

## CDN request URLs

URL patterns differ by origin type.

### Object Storage origin

The addressing scheme `<bucket-name>.luxembourg-2.storage.gcore.dev` hides the storage hostname from CDN requests, keeping the origin private.

Use the following format to request files through CDN:

`http(s)://<custom-domain>/<folder>/<file>`

If files are in the bucket root rather than a subfolder, omit `<folder>` from the URL.

Given a bucket `mybucket` at `luxembourg-2.storage.gcore.dev` and a CDN resource with custom domain `cdn.example.com`, request `picture.png` using:

`http://cdn.example.com/picture.png`

> [!NOTE]
>
> By default, buckets and all stored files are private. To make files public, configure [ACL rules](/storage/manage-object-storage/configure-aws-sli-s3cmd-and-aws-javascript-sdk/configure-access-control-on-s3-storage-with-aws-cli-and-s3cmd) using AWS CLI or S3cmd, or follow the [Amazon ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) documentation.

### SFTP Storage origin

Upload files to the `htdocs` directory in the SFTP storage. When requesting content through CDN, omit the directory from the URL.

Path to a file in the storage:

`sftp://12345-test@ams.origin.gcdn.co:2200/export/home/12345-test/htdocs/picture.png`

If the CDN custom domain is `cdn.example.com`, the request URL is:

`http://cdn.example.com/picture.png`
