全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

查询域名详细配置信息

最近更新时间:2025-07-10 16:36:20

GetDomainConfigs

描述

本接口用于获取指定加速域名的详细配置信息。

请求语法

本接口请求需要包含指定目录/2019-06-01/domain/GetDomainConfigs、公共请求header和该接口所特有的请求参数,具体请求语句参照下文请求示例。

请求参数

参数名

必选

类型及范围

说明

DomainId

String

域名ID

ConfigList

String

需要查询的配置,多个配置用逗号(半角)分隔。不填代表查询所有,具体参数说明见下表

ConfigList

参数名

类型及范围

说明

返回参数名

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

page_compress

参数名

必选

类型及范围

说明

CompressType

String

压缩方式类型,取值:GZIP:GZIP压缩;默认为GZIP

FileType

String

Content-Type值;支持传入多个,多个取值间用,分割; 默认为所有支持的18个Content-Type值

FileSize

String

压缩文件大小范围,单位Byte,输入格式实例:1024-2048; 默认为1024-31457280
底层参数限制:最小长度:1024 byte,最大长度:31457280 byte

Br_compress

参数名

必选

类型及范围

说明

CompressType

String

压缩方式类型,取值:BR:BR压缩; 默认为BR

FileType

String

Content-Type值;支持传入多个,多个取值间用,分割; 默认为所有支持的18个Content-Type值

FileSize

String

压缩文件大小范围,单位Byte,输入格式实例:1024-2048; 默认为1024-31457280
底层参数限制:最小长度:1024 byte,最大长度:31457280 byte

CacheKeyRuleConfig

一级参数名

二级参数名

三级参数名

类型及范围

说明

Enable

String

配置开关,取值为: on:开启 off:关闭

RulesList

Array

配置信息,包括全局配置+条件配置

  • 当条件配置开启时,RulesList包含全局配置+所有条件配置;

  • 当条件配置关闭时,RulesList只包含全局配置

EffectType

String

生效范围,取值为:

  • global:全局配置

  • conditional:条件配置

EffectRules

Array

生效条件详情
当一个条件配置中包含多个条件时,将展示所有条件

ParamName

String

条件参数名称

MetaData

String

条件类型,取值为:
urlParam:URL参数
cookie:请求头
Cookie request
Header:请求Header
responseHeader:响应Header
cdnCode:CDN响应状态码
originCode:源站响应状态码
initialUri:原始uri
path:全路径
rewriteUri:改写后uri
remotePort:请求源端口号
protocolVersion:协议版本
requestMethod:请求方法
requestTimeRange:请求时间段
isp:运营商
clientIp:客户端IP
clientIpv6:客户端Ipv6
clientIpType:客户端Ip类型
userAgent:请求头User-Agent
referer:请求头referer
requestProtocol:请求协议
status:缓存状态
nginxVariable:nginx内置变量
cdnNodeName:CDN节点名称
effectPercent:生效百分比

LogicalOperation

String

逻辑判断方式,取值为:
exist:存在
unexist:不存在
match:匹配
missmatch:不匹配
gt:大于
lt:小于
eq:等于
ge:大于等于
le:小于等于
ne:不等于

RuleValue

Array

条件值,如有多个,用英文逗号分隔

CacheKeyRules

Json

缓存key规则

ShareCacheDomain

String

共享缓存域名

一级参数名

二级参数名

类型及范围

说明

CacheRules

Array

CacheRuleType

String

缓存规则类型(CacheRuleType)包括:

  • 文件后缀 - file_suffix:文件后缀名,如输入多个须以半角逗号分隔,如:jpg,txt,mp4

  • 目录 - directory:单条输入,目录必须以/开头且以/结尾,如:/www/dir/aaa/。若需要设置域名下全部目录,则直接输入/即可

  • 全路径 - exact:单条输入,全路径须以 / 开头,如:/www/dir/aaa

  • URI正则匹配 - url_regex:单条输入,如:^/[^/]$

  • 默认缓存规则 - global:即全部请求均按默认缓存规则走

CacheTime

String

缓存时长,单位:秒

RespectOrigin

String

是否遵循源站:

  • on:遵循源站

  • off:强制缓存

CacheEnable

String

缓存规则开关:

  • on:开启

  • off:关闭

返回参数

参数名

类型及范围

说明

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-01

POST方式:

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将错误码集中归类,请到【使用须知】查看详情。

文档导读
纯净模式常规模式

纯净模式

点击可全屏预览文档内容
文档反馈