最近更新时间:2025-07-10 16:36:20
本接口用于获取指定加速域名的详细配置信息。
本接口请求需要包含指定目录/2019-06-01/domain/GetDomainConfigs、公共请求header和该接口所特有的请求参数,具体请求语句参照下文请求示例。
参数名 | 必选 | 类型及范围 | 说明 |
|---|---|---|---|
DomainId | 是 | String | 域名ID |
ConfigList | 否 | String | 需要查询的配置,多个配置用逗号(半角)分隔。不填代表查询所有,具体参数说明见下表 |
参数名 | 类型及范围 | 说明 | 返回参数名 |
|---|---|---|---|
cache_key_rule | String | 缓存key规则 | CacheKeyRuleConfig |
cache_expired | String | 缓存策略 | CacheRuleConfig |
ip | String | IP防盗链配置 | IpProtectionConfig |
http_header | String | 设置http头 | HttpHeadersConfig |
http_headers_v2 | String | 设置http头 2.0 | HttpHeadersConfigV2 |
ignore_query_string | String | 过滤参数 | IgnoreQueryStringConfig |
referer | String | Refer防盗链功能 | ReferProtectionConfig |
src_host | String | 设置回源host | BackOriginHostConfig |
video_seek | String | 设置拖拽 | VideoSeekConfig |
certificate | String | 设置服务证书 | CertificateConfig |
request_auth | String | 时间戳+共享密钥防盗链配置 | RequestAuthConfig |
http2_option | String | 设置HTTP 2.0 | Http2OptionConfig |
force_redirect | String | 设置强制跳转 | ForceRedirectConfig |
page_compress | String | 设置Gzip压缩 | PageCompressConfig |
Br_compress | String | 设置Br压缩 | BrCompressConfig |
error_page | String | 自定义错误页面 | ErrorPageConfig |
url_rewrite_and_redirect | String | URL修改及跳转 | UrlRewriteAndRedirectConfig |
http_code_cache_rule | String | 状态码缓存规则 | HttpCodeCacheRuleConfig |
origin_advanced_config | String | 高级回源配置 | OriginAdvancedConfig |
ua_protection | String | UA黑白名单 | UaProtectionConfig |
cache_key | String | 缓存key配置 | CacheKeyConfig |
error_code_cache_rule | String | 错误状态码缓存规则 | ErrorCodeCacheRuleConfig |
conditional_http_header | String | 条件HTTP头 | ConditionalHttpHeadersConfig |
global_access_control | String | 全局限速 | GlobalAccessControlConfig |
tls_version | String | TLS版本 | TLSVersionConfig |
ocsp | String | OCSP开关 | OcspConfig |
参数名 | 必选 | 类型及范围 | 说明 |
|---|---|---|---|
CompressType | 否 | String | 压缩方式类型,取值:GZIP:GZIP压缩;默认为GZIP |
FileType | 否 | String | Content-Type值;支持传入多个,多个取值间用,分割; 默认为所有支持的18个Content-Type值 |
FileSize | 否 | String | 压缩文件大小范围,单位Byte,输入格式实例:1024-2048; 默认为1024-31457280 |
参数名 | 必选 | 类型及范围 | 说明 |
|---|---|---|---|
CompressType | 否 | String | 压缩方式类型,取值:BR:BR压缩; 默认为BR |
FileType | 否 | String | Content-Type值;支持传入多个,多个取值间用,分割; 默认为所有支持的18个Content-Type值 |
FileSize | 否 | String | 压缩文件大小范围,单位Byte,输入格式实例:1024-2048; 默认为1024-31457280 |
一级参数名 | 二级参数名 | 三级参数名 | 类型及范围 | 说明 |
|---|---|---|---|---|
Enable | String | 配置开关,取值为: on:开启 off:关闭 | ||
RulesList | Array | 配置信息,包括全局配置+条件配置
| ||
EffectType | String | 生效范围,取值为:
| ||
EffectRules | Array | 生效条件详情 | ||
ParamName | String | 条件参数名称 | ||
MetaData | String | 条件类型,取值为: | ||
LogicalOperation | String | 逻辑判断方式,取值为: | ||
RuleValue | Array | 条件值,如有多个,用英文逗号分隔 | ||
CacheKeyRules | Json | 缓存key规则 | ||
ShareCacheDomain | String | 共享缓存域名 |
一级参数名 | 二级参数名 | 类型及范围 | 说明 |
|---|---|---|---|
CacheRules | Array | ||
CacheRuleType | String | 缓存规则类型(CacheRuleType)包括:
| |
CacheTime | String | 缓存时长,单位:秒 | |
RespectOrigin | String | 是否遵循源站:
| |
CacheEnable | String | 缓存规则开关:
|
参数名 | 类型及范围 | 说明 |
|---|---|---|
DomainConfigs | String | 对应的配置数据,参考上面ConfigList的请求参数名和返回参数名的对应关系 |
请求示例
GET方式:
GET /2019-06-01/domain/GetDomainConfigs?DomainId=2D07ANU 1.1
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetDomainConfigs
x-version: 2019-06-01POST方式:
POST /2019-06-01/domain/GetDomainConfigs 1.1
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetDomainConfigs
x-version: 2019-06-01
Content-Type: application/json
{
"DomainId":"2D07ANU"
}返回示例
{
"CacheRuleConfig": {
"CacheRules": [
{
"CacheRuleType": "directory",
"Value": "/XXX/",
"CacheTime": 11,
"RespectOrigin": "on",
"CacheEnable": "on"
},
{
"CacheRuleType": "exact",
"Value": "/XXX/XXX.TXT",
"CacheEnable": "off"
},
{
"CacheRuleType": "global",
"CacheTime": 2592000,
"RespectOrigin": "off",
"CacheEnable": "on"
}
]
},
"IpProtectionConfig": {
"Enable": "on",
"IpType": "block",
"IpList": "2.1.1.1,3.1.1.1,103.200.110.0-103.200.110.254,10.10.10.0/24,1::1,6001:8:0:23:8:800:200:417A/127"
},
"HttpHeadersConfig": {
"HttpHeaderRules": [
{
"HttpHeaderRuleType": "",
"HeaderKey": "haha",
"HeaderValue": "666"
},
{
"HttpHeaderRuleType": "",
"HeaderKey": "heihei",
"HeaderValue": "777"
}
]
},
"PageCompressConfig": {
"Enable": "on",
"CompressType": "BR",
"FileType": "application/atom+xml,application/javascript,application/x-javascript,application/xhtml+xml,application/xml,application/xml+rss,application/xml-dtd,text/css,text/htm,text/html,text/javascript,text/js,text/json,text/plain,text/xml,application/json,application/x-font-ttf,image/svg+xml",
"FileSize": "1024-31457280"
},
"IgnoreQueryStringConfig": {
"Enable": "off"
},
"BackOriginConfig": {
"Enable": ""
},
"ReferProtectionConfig": {
"Enable": "on",
"ReferType": "block",
"ReferList": "www.test.com,www.baidu.com",
"AllowEmpty": "on"
},
"BackOriginHostConfig": {
"BackOriginHost": "www.test.com"
},
"VideoSeekConfig": {
"Enable": "on"
},
"OriginAdvancedConfig": {
"OriginPolicy": "rr",
"OriginProtocol": "http",
"OriginPort": "80",
"OriginHeaderRules": [],
"EnableFollow302": "off",
"EnableIgnoreQueryString": "off",
"EnableFragmentBackSource": "off",
"MainOriginRule": {
"OriginType": "ipaddr",
"Origin": "99.9.9.9",
"OriginHost": "www.test.com"
},
"BackupOriginRule": {
"BackupOriginType": "domain",
"BackupOrigin": "wcdn-20220304.baidu.com"
},
"EnableBackupOrigin": "on",
"OriginNormalAuthEnable": "off",
"OriginTOSAuthEnable": "off"
},
"TestUrlConfig": {
"TestUrl": ""
},
"CertificateConfig": {
"Enable": "on",
"CertificateId": "12766"
},
"RequestAuthConfig": {
"Enable": "on",
"AuthType": "typeA",
"Key1": "aohdsaodfhsahfsadyf",
"ExpirationTime": 666,
"ConditionalConfigs": []
},
"Http2OptionConfig": {
"Enable": "off"
},
"ForceRedirectConfig": {
"RedirectType": "off"
},
"ErrorPageConfig": {
"ErrorPages": [
{
"ErrorHttpCode": "404",
"CustomPageUrl": "https://www.test.com/error404.html"
},
{
"ErrorHttpCode": "403",
"CustomPageUrl": "https://www.test.com/error403.html"
}
]
},
"BackOriginBaseConfig": {
"OriginType": "ipaddr",
"Origin": "99.9.9.9",
"OriginProtocol": "http"
},
"UaProtectionConfig": {
"Enable": "off"
},
"CacheKeyConfig": {
"Enable": "off"
},
"ErrorCodeCacheRuleConfig": {
"ErrorCodeRules": []
},
"ConditionalHttpHeadersConfig": {
"ConditionalRules": []
},
"GlobalAccessControlConfig": {
"ControlRules": [
{
"ControlRangeType": "directory",
"ControlRangeValue": "/api/",
"ControlRuleType": "TypeA",
"ControlRuleValue": "8/30,20/60",
"ForbidDuration": 300,
"AccessStatisticsDuration": 300
},
{
"ControlRangeType": "exact",
"ControlRangeValue": "/file/1.jpg",
"ControlRuleType": "TypeB",
"ControlRuleValue": "60",
"ForbidDuration": 200,
"AccessStatisticsDuration": 300
}
]
},
{
"CacheRuleConfig": {
"CacheRules": [
{
"CacheRuleType": "global",
"CacheTime": 300,
"RespectOrigin": "off",
"CacheEnable": "on"
},
{
"CacheRuleType": "url_regex",
"Value": "/test1/",
"CacheTime": 0,
"RespectOrigin": "off",
"CacheEnable": "on"
}
]
}
}
}为了帮您快速定位问题,WCDN将错误码集中归类,请到【使用须知】查看详情。
纯净模式