Child pages
  • Edit HTTP Push CDN Resource with Advanced Settings
Skip to end of metadata
Go to start of metadata

To edit HTTP Push CDN resource:

PUT /cdn_resources/:cdn_resource_id.xml
PUT /cdn_resources/:cdn_resource_id.json

XML Request example

curl -i -X PUT -u user:userpass http://onapp.test/cdn_resources/12712.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<cdn_resource><cdn_hostname>sfcdn.123apitest.com</cdn_hostname><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id type="integer">225</edge_group_id></edge_group_ids><ftp_password>qwertyuiopqwer</ftp_password><secondary_hostnames type="array"><secondary_hostname>name1nedwqwtest.con</secondary_hostname><secondary_hostname>nafme2newqtest.con</secondary_hostname></secondary_hostnames><ip_access_policy>ALLOW_BY_DEFAULT</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_addresses><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><url_signing_on>1</url_signing_on><url_signing_key>newtest12345</url_signing_key><password_on>1</password_on><form_pass><user type="array"><string>user123new</string><string>user234new</string></user><pass type="array"><string>passw123new</string><string>passw234new</string></pass></form_pass><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html><domains>example.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><flv_pseudo_on>1</flv_pseudo_on><mp4_pseudo_on>1</mp4_pseudo_on><limit_rate>140</limit_rate><limit_rate_after>11</limit_rate_after></cdn_resource>' 


JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/12713.json -d '{"cdn_resource":{"cdn_hostname":"Jcdn.apitestruhu.com","cdn_ssl_certificate_id":"ssl_cert_id","edge_group_ids":["225"],"ftp_password":"password123","secondary_hostnames":["name1test12.co","name2test34.co"],"ip_access_policy":"ALLOW_BY_DEFAULT","ip_addresses":"10.10.5.6,125.125.125.125","country_access_policy":"BLOCK_BY_DEFAULT","countries":["AL","AR","GT","HR"],"hotlink_policy":"ALLOW_BY_DEFAULT","domains":"mnw.netggl12.com","url_signing_on":"1","url_signing_key":"new123456789321","password_on":1,"form_pass":{"user":["user190","user278"],"pass":["pass123","pass2348"]},"password_unauthorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","flv_pseudo_on":"1","limit_rate":"80","limit_rate_after":"13"}}'


Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect.

Where:

origin* - the path from which the CDN requests the content

(lightbulb) cdn_hostname* - indicate the hostname which will serve static content

SSL

If the CDN hostname ends with '.r.worldssl.net', SSL will be enabled automatically.

To disable, remove the '.r.worldssl.net' ending and set the "ssl_on":false parameter. To enable, add the '.r.worldssl.net' ending to the cdn_hostname and set the "ssl_on":true parameter.

(lightbulb)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

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.

<secondary_hostnames type="array">	
	<secondary_hostname>test100.com</secondary_hostname>
	<secondary_hostname>test200.com</secondary_hostname>
</secondary_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.

advanced_settings* - set 1 to enable advanced settings:

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, 20.20.20.0/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.

cache_expiry - set the cache expiry time in minutes

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).

password_on - set 1, if the access to the resource is restricted; otherwise 0

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 [ _ ], dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated.

password_unauthorized_html – the message that is displayed when there is unauthorized access. 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

ignore_set_cookie_on -set 1  to enable caching content with Set-Cookie response headers, otherwise set 0

Nginx Settings

  • 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

 

 

Page History

v. 4.0

  • Updated cdn_hostname parameter with ability to enable or disable SSL
  • Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels