Domains /
Enable CDN on a subdomain
Enables a CDN integration on the given subdomain
Required permission
Account > Subdomains > General > Update
Path parameters
domain
string requiredName of the domainsubdomain
string requiredName of the subdomain
Request body
- {object}Use Fastly as a CDN
provider
string requiredProvider for which a CDN on the subdomain should be enabled.options
{object}service
{object}forceTlsEnableHsts
booleanhstsDuration
numberHSTS duration. Required when `forceTlsEnableHsts` is `true`.min300staleIfError
booleanstaleIfErrorTtl
numberdefaultTtl
numberlogging
{object}enabled
booleanhttp3
{object}enabled
booleanwebsockets
{object}enabled
booleancompression
{object}enabled
booleanmode
stringCompression options. Required when `enabled` is `true`.one ofgzip, brotlivclSnippets
[array]- {object}
id
stringname
string requiredmin length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$type
string requiredone ofinit, recv, hash, hit, miss, pass, fetch, error, deliver, log, nonedynamic
string requiredone of0, 1priority
number requiredmin0max100content
string requiredcacheSettings
[array]- {object}
id
stringname
string requiredmin length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$action
stringone ofpass, cache, restartcacheCondition
stringstaleTtl
number requiredttl
number required
OR
- {object}Use Cloudfront as a CDN
provider
string requiredProvider for which a CDN on the subdomain should be enabled.options
{object}
Response body
- {object}Response object.
data
{object} requiredResult data.
API
CLI
JS Client
POST /v1/domains/{domain}/subdomains/{subdomain}/cdn/enable
Example request
Request body
Use Fastly as a CDN
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"provider":"fastly"}' \
https://api.northflank.com/v1/domains/{domain}/subdomains/{subdomain}/cdn/enable
OR
Use Cloudfront as a CDN
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"provider":"cloudfront"}' \
https://api.northflank.com/v1/domains/{domain}/subdomains/{subdomain}/cdn/enable
Example response
200 OK
The operation was performed successfully.
JSON
{
"data": {}
}