Scaleway Documentationtutorials
s3 customize url cname

Jump toUpdate content

S3 Object Storage - Customizing URLs with CNAME

Reviewed on 10 May 2021Published on 21 May 2019
  • Object-Storage
  • CNAME
  • domain
  • S3
  • buckets

Custom domain name with CNAME

Depending on the services you provide you might not want the scw.cloud domain name to appear on your website. For example if you provide files to download or host the images of your website on Object Storage. In this case you might prefer a domain name like download.mywebsite.com instead of providing links like download.mywebsite.com.s3.fr-par.scw.cloud.

By using CNAME you can map a domain or subdomain to an Object Storage bucket and access the files stored in the bucket via your own domain name.

Requirements:
  • You have an account and are logged into the Scaleway Console
  • You have an Object Storage bucket with activated bucket website feature
  • You have access to the DNS zone of your domain name

Configuring a custom Domain name

  1. To use a customized domain name with a bucket, connect to your management console, enter the Object Storage section and create a new bucket.

  2. It is important that the bucket name is exactly the same as the domain/subdomain intended to be used with it. For example, to create a bucket, accessible at download.example.com the bucket name must be download.example.com.

  3. Set the bucket ACL with AWS-CLI:

    aws s3api put-bucket-acl --bucket download.example.com --acl public-read
  4. Log into the administration panel of your domain and create a new record that defines the hostname as an alias for the bucket. For example if the bucket download.example.com is located in the Paris Region, the CNAME should point to download.example.com.s3.fr-par.scw.cloud:

  5. It is now possible to access the file myapp.tar.gz stored in the bucket download.example.com directly at http://download.example.com/myapp.tar.gz instead of the usual URL http://download.example.com.s3.fr-par.scw.cloud/myapp.tar.gz.

    Important:

    Please note that SSL is not available when using this way to connect to a bucket.