Skip to main content

Setting a Custom Domain

If you use Arvancloud Object Storage, you may need to access your files with a domain address other than Object Storage's default address. The Custom Domain feature of Object Storage lets you share your files through your own domain name. This feature is also available through settings in the CDN panel.

Arvancloud Object Storage uses the Arvancloud CDN by default and defines a subdomain of the main domain (s3.[region].arvanstorage.ir) for each bucket created. When a custom domain is defined for a bucket, the user's request is checked by DNS, which returns the request's record (ANAME or CNAME) to the CDN; the CDN then changes the Host header from the custom domain to the bucket's domain and sends the request to Object Storage.

This guide covers two ways to set up a custom domain in Object Storage.

Step 1: Add the Domain to the Arvancloud CDN​

The format of file addresses in Arvancloud Object Storage is a combination of the bucket name, the Arvancloud Object Storage domain, and the file name. For example, if we upload a file named arvan.png to the arvan-test bucket in the Simin region, we access the file at arvan-test.s3.ir-thr-at1.arvanstorage.ir/arvan.png.

To set a custom domain on Arvancloud Object Storage, you first need to add your domain in the Arvancloud CDN. Note that to enable a custom domain in Object Storage, you must enable HTTPS on the domain using your own SSL certificate or the free Arvancloud certificate.

Step 2: Enable a Custom Domain for the Bucket​

After adding the domain to the Arvancloud CDN, you can enable the Custom Domain feature for your bucket in the Object Storage panel. First create the bucket you want, then select Custom Domain from the bucket's actions.

On the new page, you can review the list of custom domains defined for the bucket, and click New Custom Domain to define a new domain.

On the new page that opens, you need to choose the bucket address, the domain registered in the Arvancloud CDN, and the subdomain.

Choosing the bucket address: In this section, you need to choose one of the bucket's addresses. Each bucket has different domains.

  • Main domain address: Each bucket is connected by default to Object Storage's main domain address, (s3.[region].arvanstorage.ir).
  • Static website domain address: If the static website feature is enabled on the bucket, you can use the bucket's static website address, which follows (s3-website.[region].arvanstorage.ir).

Choosing the domain registered in Arvancloud: In this section, select the domain you want connected to the bucket. Note that if HTTPS isn't enabled on the domain, an activation warning is shown to you.

If you want to connect the root domain to the bucket, after selecting the domain click Create to apply the DNS settings for the domain.

Since the settings are applied to the root domain, an ANAME record with the bucket's address as its value is created in your domain's CDN panel, which you can see in the DNS Records section of the CDN panel. You can also create this record for the bucket independently in the CDN panel, without using this Object Storage feature.

In this case, note the following:

  • The cloud icon of this record must be on.
  • Using the edit option next to this record, you need to change the record's Host header to the record's value, that is, bucketname.s3.[region].arvanstorage.ir.

Note that changing the Host header to the Arvancloud Object Storage address is free for accounts on the CDN Basic plan.

To learn more about Arvancloud DNS record types, see the guide Managing Arvancloud DNS Records.

Setting a subdomain: If you want to connect your subdomain to the bucket, simply enable Set Subdomain, enter the subdomain's name in the box next to it, and click Create.

In this case, a CNAME record is created in the CDN's DNS records, which, as in the previous section, can be viewed or edited through the CDN panel.

If you need to edit or delete your custom domain, you can make the changes you want through the bucket's custom domains section in Object Storage, or through the DNS record settings of that domain in the CDN panel.