Skip to main content

CNAME Access Management

In some network architectures, other domains need to be CNAMEd to your domain and send their HTTP requests with your domain's Host header. For security reasons, this is blocked by default in the Arvancloud CDN.

With the following APIs, you can lift this restriction in two different ways:

  • Per-Account: Granting access to one specific account only
  • Global: Granting access to all accounts

Granting Access to a Specific Account​

With this method, you can allow (whitelist) a specific account ID so that only that account is allowed to use your domain as the Host in HTTP requests.

Sample request

curl -X POST "https://napi.arvancloud.ir/cdn/4.0/domains/example.com/host-header-whitelists" \
-H "Authorization: Apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target_account": "123e4567-xxxx-xxxx-xxxx-426614174000"
}'

The value of the target_account parameter must be the ID of the destination account.

Granting Global Access​

By calling this method, your domain is added to the Global Host Allowlist, and from then on any account in the Arvancloud CDN can use your domain as the HTTP Host in its requests.

Sample request

curl -X PUT "https://napi.arvancloud.ir/cdn/4.0/domains/example.com/host-header-whitelists/settings" \
-H "Authorization: Apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"global": true
}'

The API documentation for this feature provides more details.