API
The Gcore Customer Portal is being updated. Screenshots may not show the current version.
Storage
Storage
Chosen image
Home/Storage/Use storage with CDN

Use storage as the origin for your CDN resource

Use as an origin

Use Object Storage

1. Go to the CDN tab and press Create CDN resource.

CDN resource

2. Select which Object Storage you want to use as a content source: public or private - and follow the instructions.

Set up initial configuration

1. Select the Specify content origin option.

2. Select None in the "Type of origin authentication" option.

3. Specify the path to your bucket in following format: http(s)://<bucket-name>.<location>.cloud.gcore.lu. More details in the "Request content directly from the Object Storage" section below.

4. Specify custom domain, e.g., cdn.example.com. Read more about the personal domain setup in the "Create and set a custom domain for the content delivery via CDN" guide.

If you want to use a private bucket instead of a public S3 bucket, follow our guide on how to use a private bucket as an origin.

Use SFTP storage

Go to the CDN tab and press Create CDN resource.

Use SFTP storage

To specify the Origin Source, use the following schema:

<storage name>.<hostname>

Both name and hostname can be found on the Storage tab > Storages > Details.

Set up initial configuration

If your storage name is 12345-test and your hostname is ams.origin.gcdn.co, you should specify 12345-test.ams.origin.gcdn.co as the Origin Source. Read more about personal domain setup in the "Create and set a custom domain for the content delivery via CDN" guide.

Request content from CDN

Object Storage is the origin

An addressing scheme where you specify the bucket at the beginning <bucket-name>.<location>.cloud.gcore.lu allows you to increase the security of your CDN usage because you hide the Hostname of your repository.

Use the following schema to request uploaded files:

http(s)://<Custom domain>/<folder*>/<file>

*If the folder was created in the bucket. If files were added to the root of the bucket - specify file names.  

For example, you've: 

  • used a bucket mybucket, S3 storage in the Luxembourg location s-ed1.cloud.gcore.lu
  • created a CDN resource for the storage with the Custom domain with cdn.example.com.

 

To request file picture.png, which was uploaded into the bucket, from CDN use the following URL:

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

Note: By default, created buckets and all the stored files in buckets are private. To make a file public, read the article on ACL and policy or official documentation.

SFTP storage is the origin

Upload your files to the htdocs directory, but don't specify the directory when requesting the content.

Path to the uploaded 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 URL to request the file from CDN will be:

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

Was this article helpful?

Not a Gcore user yet?

Check out our Storage

Go to the product page