回源配置
更新时间:2023-05-16
设置回源地址
$domain = "test.domain.com";
$origins = array(
// 回源地址test.origin-new.domain.com,回源Host www.origin-host.com
array(
"peer" => "test.origin-new.domain.com",
"host" => "www.origin-host.com"
),
array(
"peer" => "12.34.56.78",
"host" => "www.origin-host.com"
) // 不能同时存在
);
$resp = $client->setDomainOrigin($domain, $origins);
print_r($resp);
设置协议跟随回源
$followProtocol = array(
'followProtocol' => true
);
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->setDomainFollowProtocol($domain, $followProtocol);
print_r($resp);
设置 Range 回源
$rangeSwitch = array(
'rangeSwitch' => true
);
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->setDomainRangeSwitch($domain, $rangeSwitch);
print_r($resp);
查询 Range 回源
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->getDomainRangeSwitch($domain);
print_r($resp);
设置移动访问控制
$mobileAccess = array(
'mobileAccess' => array(
"distinguishClient" => true
)
);
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->setDomainMobileAccess($domain, $mobileAccess);
print_r($resp);
查询移动访问控制
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->getDomainMobileAccess($domain);
print_r($resp);