To create an HTTP resource with advanced settings, use the following request:
XML Request example
JSON Request example
cdn_hostname* - indicate the hostname which will serve static content. Specify the following fourth-level domain name for this parameter to create a resource with SSL enabled: "example.r.worldssl.net", where replace the example with the desired name.
resource_type* - HTTP_PUSH
cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated.
edge_group_ids* - indicate the ID(s) of required CDN edge groups
storage_server_location - the ID of the storage server location which should be assigned to this resource. To get the ID of the required storage server location, use the request described at the Get List of Available Storage Locations section. If no location set, the first active storage server is chosen automatically.
ftp_password* - indicate the FTP server password. It should consist of 6-32 alphanumeric symbols.
secondary_hostnames - an array of secondary CDN hostnames. You can add up to 7 secondary CDN hostnames.
To be able to use a secondary hostname for the CDN resource with SSL enabled, you require an SSL certificate for your custom hostname. For help with questions about the SSL certificate purchase, please contact OnApp support.
ip_access_policy - configure a rule to control access to the CDN resource's content for a range of IP addresses:
- ALLOW_BY_DEFAULT - allow IP access policy by default, except for IP addresses specified in the ip_addresses parameter
- BLOCK_BY_DEFAULT - block IP access policy by default, except for IP addresses specified in the ip_addresses parameter
- NONE - switch off the IP access policy
ip_addresses - IP address(es) related to ip_access_policy parameter; The comma-separated list of IP addresses or IP ranges allowed/blocked by default. Use the following format "10.10.10.10, 184.108.40.206/24"
hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking:
- ALLOW_BY_DEFAULT - allow hotlink policy by default, except for domains specified in the domains parameter
- BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter
- NONE - switch off the rule
domains - domains related to hotlink_policy
country_access_policy - configure a rule to control access to the CDN resource's content for specified countries:
- ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter
- BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter
- NONE - switch off the country access policy
countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format.
url_signing_on - set 1 to enable and protect your files from unauthorized access with a key
url_signing_key - input the key for URL signing. Input letters and digits (6-32 symbols).
form_pass - an array with usernames and passwords to access the resource:
pass - the user password.
user - the user login, which may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], underscore [ _ ], and dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated.
password_unauthorized_html - text, which will be displayed in case of fail of authentication. Max 1000 chars.
mp4_pseudo_on - set 1 to enable MP4 preudo streaming, otherwise set 0
flv_pseudo_on - set 1 to enable FLV preudo streaming, otherwise set 0
- limit_rate - sets speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s
- limit_rate_after - sets the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB
- Updated cdn_hostname parameter with ability to enable SSL
- Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource
- Added storage_server_location parameter.