跳转至

更新域名配置

1. 接口描述

接口请求路径:POST /prod-api/acdn/tcdn/domainRest/updateDomainConfig

updateDomainConfig 用于更新当前账号下已接入的国内 TCDN 加速域名配置。请求体为 { "request": { ... } }request.domain 必填。账号需具备 tcdn:EditDomain 权限。

Token 获取方式见 密钥鉴权

注意

  • request 不能为空。request.domain 须属于当前账号。
  • 若需更新复杂类型配置,必须传递该对象的全部属性,未传递的属性将使用默认值。建议先调用 查询域名详细配置 获取当前配置,修改后再提交本接口。若仅修改某一配置项,只传对应参数即可。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
request UpdateDomainConfig 待更新的配置

3. 输出参数

参数名称 类型 描述
code Integer 状态码。示例值:200
msg String 提示信息。示例值:成功

4. 示例

示例1 更新源站

输入示例

{
  "request": {
    "domain": "www.test.com",
    "origin": {
      "originPullProtocol": "http",
      "originType": "ip",
      "serverName": "www.test.com",
      "origins": ["1.1.1.1"]
    }
  }
}

代码调用

请将 {登录域名}token 替换为实际值。

curl -X POST 'https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "request": {
    "domain": "www.test.com",
    "origin": {
      "originPullProtocol": "http",
      "originType": "ip",
      "serverName": "www.test.com",
      "origins": ["1.1.1.1"]
    }
  }
}'
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class UpdateDomainConfigTest {

    public static void main(String[] args) throws Exception {
        String url = "https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig";
        String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";

        String requestBody = "{"
                + "\"request\":{"
                + "\"domain\":\"www.test.com\","
                + "\"origin\":{"
                + "\"originPullProtocol\":\"http\","
                + "\"originType\":\"ip\","
                + "\"serverName\":\"www.test.com\","
                + "\"origins\":[\"1.1.1.1\"]"
                + "}"
                + "}"
                + "}";

        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Authorization", "Bearer " + token);
            httpPost.setEntity(new StringEntity(requestBody, ContentType.APPLICATION_JSON));

            try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
                int statusCode = response.getStatusLine().getStatusCode();
                String body = EntityUtils.toString(response.getEntity(), "UTF-8");
                System.out.println("Status Code: " + statusCode);
                System.out.println("Body: " + body);
            }
        }
    }
}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig"
    token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"

    requestBody := []byte(`{
  "request": {
    "domain": "www.test.com",
    "origin": {
      "originPullProtocol": "http",
      "originType": "ip",
      "serverName": "www.test.com",
      "origins": ["1.1.1.1"]
    }
  }
}`)

    req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(requestBody))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer "+token)
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println("Status Code:", resp.StatusCode)
    fmt.Println("Body:", string(body))
}

输出示例

{
  "msg": "成功",
  "code": 200
}

示例2 关闭 HTTPS

输入示例

{
  "request": {
    "domain": "www.test.com",
    "https": {
      "switch": "off"
    }
  }
}

代码调用

请将 {登录域名}token 替换为实际值。

curl -X POST 'https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "request": {
    "domain": "www.test.com",
    "https": {
      "switch": "off"
    }
  }
}'
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class UpdateDomainConfigHttpsOffTest {

    public static void main(String[] args) throws Exception {
        String url = "https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig";
        String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";

        String requestBody = "{"
                + "\"request\":{"
                + "\"domain\":\"www.test.com\","
                + "\"https\":{\"switch\":\"off\"}"
                + "}"
                + "}";

        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Authorization", "Bearer " + token);
            httpPost.setEntity(new StringEntity(requestBody, ContentType.APPLICATION_JSON));

            try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
                int statusCode = response.getStatusLine().getStatusCode();
                String body = EntityUtils.toString(response.getEntity(), "UTF-8");
                System.out.println("Status Code: " + statusCode);
                System.out.println("Body: " + body);
            }
        }
    }
}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://{登录域名}/prod-api/acdn/tcdn/domainRest/updateDomainConfig"
    token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"

    requestBody := []byte(`{
  "request": {
    "domain": "www.test.com",
    "https": {
      "switch": "off"
    }
  }
}`)

    req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(requestBody))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer "+token)
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println("Status Code:", resp.StatusCode)
    fmt.Println("Body:", string(body))
}

输出示例

{
  "msg": "成功",
  "code": 200
}

5. 错误码

HTTP 状态码 / 业务提示 描述
200 成功
401 未鉴权或 Token 无效
403 无权限
参数不能为空 未传请求体,或未传 request
域名不能为空 request.domain 为空
域名不属于你 指定域名未接入或不属于当前账号
error code:{0},message:{1} 上游更新失败,{0} 为错误码,{1} 为原因

6. 数据模型

已在 查询域名详细配置 展开的配置块(如 origincachehttps)请点类型链接查看字段。本页补充其余配置块;更新复杂对象时须提交全部属性,未传属性将使用默认值。

UpdateDomainConfig

待更新的域名配置。除 domain 外均为可选;未出现的配置块不修改。

参数名称 必选 类型 描述
domain String 加速域名。示例值:www.test.com
projectId Integer 项目 ID。示例值:0
origin Origin 源站配置
ipFilter IpFilter IP 黑白名单配置
ipFreqLimit IpFreqLimit IP 限频配置
statusCodeCache StatusCodeCache 状态码缓存配置
compression Compression 智能压缩配置
bandwidthAlert BandwidthAlert 带宽封顶配置
rangeOriginPull RangeOriginPull Range 回源配置
followRedirect FollowRedirect 301/302 回源跟随配置
errorPage ErrorPage 错误码重定向配置
requestHeader RequestHeader 回源请求头配置
responseHeader ResponseHeader 响应头配置
downstreamCapping DownstreamCapping 下载速度配置
cacheKey CacheKey 节点缓存键配置
responseHeaderCache ResponseHeaderCache 头部缓存配置
videoSeek VideoSeek 视频拖拽配置
cache Cache 缓存过期时间配置
originPullOptimization OriginPullOptimization 跨国链路优化配置(已下线)
https Https HTTPS 加速配置
authentication Authentication 时间戳防盗链配置
seo Seo SEO 优化配置
forceRedirect ForceRedirect 访问协议强制跳转配置
referer Referer Referer 防盗链配置
maxAge MaxAge 浏览器缓存配置
specificConfig SpecificConfig 境内/境外加速配置不一致时的地域特殊配置
serviceType String 业务类型。取值:web(静态加速)、download(下载加速)、media(流媒体点播加速)。示例值:web
area String 加速区域。取值:mainland(中国境内)、overseas(中国境外)、global(全球)。从 mainland/overseas 改为 global 时,配置会同步到另一侧。示例值:mainland
originPullTimeout OriginPullTimeout 回源超时配置
awsPrivateAccess AwsPrivateAccess 回源 S3 私有鉴权
userAgentFilter UserAgentFilter UA 黑白名单配置
accessControl AccessControl 访问控制
urlRedirect UrlRedirect 访问 URL 重写配置
accessPort Array of Integer 访问端口配置。示例值:[80,8080]
advancedAuthentication AdvancedAuthentication 时间戳防盗链高级版(白名单功能)
originAuthentication OriginAuthentication 回源鉴权高级版(白名单功能)
ipv6Access Ipv6Access IPv6 访问配置
offlineCache OfflineCache 离线缓存
originCombine OriginCombine 合并回源
postMaxSize PostSize POST 请求传输配置
quic Quic QUIC 访问(收费服务)
ossPrivateAccess OssPrivateAccess 回源 OSS 私有鉴权
webSocket WebSocket WebSocket 配置
remoteAuthentication RemoteAuthentication 远程鉴权配置
shareCname ShareCname 共享 CNAME(白名单功能)
hwPrivateAccess HwPrivateAccess 华为云对象存储回源鉴权
qnPrivateAccess QnPrivateAccess 七牛云对象存储回源鉴权
othersPrivateAccess OthersPrivateAccess 其他厂商对象存储回源鉴权
httpsBilling HttpsBilling HTTPS 服务(收费服务)
paramFilter ParamFilter 参数黑名单
autoGuard AutoGuard 流量防盗刷配置
geoBlocker GeoBlocker 区域访问控制配置

IpFreqLimit

单节点单 IP 访问限频。超出限制的请求返回 514

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
qps Integer 每秒请求数上限。示例值:20

BandwidthAlert

带宽/流量封顶,默认为关闭。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
bpsThreshold Integer 封顶阈值。带宽单位 bps,流量单位 byte。示例值:1000000
counterMeasure String 达阈值后的操作。取值:RETURN_404(全部请求返回 404)。示例值:RETURN_404
alertSwitch String 用量提醒开关。取值:onoff。示例值:off
alertPercentage Integer 提醒百分比。示例值:80
metric String 触发维度。取值:bandwidth(带宽)、flux(流量)
statisticItems [StatisticItem] 累计用量配置

StatisticItem

累计用量封顶项。

参数名称 必选 类型 描述
switch String 开关。取值:onoff。示例值:on
type String 封顶类型。取值:total(累计)、moment(瞬时)。示例值:total
bpsThreshold Integer 带宽或流量阈值。示例值:1000000000
counterMeasure String 关闭方式。取值:RETURN_404
metric String 指标。取值:fluxbandwidth。示例值:flux
cycle Integer 检测周期,单位分钟。取值:601440。示例值:60
unBlockTime Integer 自动解封时间。示例值:60
alertSwitch String 告警开关。取值:onoff
alertPercentage Integer 提醒百分比。示例值:80

FollowRedirect

回源 301/302 自动跟随,默认为关闭。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
redirectConfig RedirectConfig 自定义 follow 请求 Host(白名单功能)

RedirectConfig

自定义回源 302 follow 的 Host。

参数名称 必选 类型 描述
switch String 开关。取值:onoff。示例值:on
followRedirectHost String 主源站 follow 时的 Host。示例值:main.host.com
followRedirectBackupHost String 备源站 follow 时的 Host。示例值:backup.host.com

RequestHeader

自定义回源请求头,默认为关闭。规则字段见 HttpHeaderPathRule

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
headerRules [HttpHeaderPathRule] 请求头规则列表

ResponseHeaderCache

源站响应头缓存,默认为开启(缓存全部头部)。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off

VideoSeek

视频拖拽,默认为关闭。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off

OriginPullOptimization

跨国回源优化(已下线)。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
optimizationType String 跨国类型。取值:OVToCN(境外回源境内)、CNToOV(境内回源境外)。示例值:OVToCN

Seo

SEO 搜索引擎优化,默认为关闭。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off

SpecificConfig

境内/境外配置不一致时使用。本接口仅支持修改部分地区配置。

参数名称 必选 类型 描述
mainland MainlandConfig 境内特殊配置
overseas OverseaConfig 境外特殊配置

MainlandConfig

境内可单独覆盖的配置,结构与本页同名配置块一致。

参数名称 必选 类型 描述
authentication Authentication 时间戳防盗链
bandwidthAlert BandwidthAlert 带宽封顶
errorPage ErrorPage 错误码重定向
ipFilter IpFilter IP 黑白名单
origin Origin 源站
referer Referer Referer 防盗链

OverseaConfig

境外可单独覆盖的配置,结构与 MainlandConfig 相同。

参数名称 必选 类型 描述
authentication Authentication 时间戳防盗链
bandwidthAlert BandwidthAlert 带宽封顶
errorPage ErrorPage 错误码重定向
ipFilter IpFilter IP 黑白名单
origin Origin 源站
referer Referer Referer 防盗链

AwsPrivateAccess

S3 源站回源鉴权。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
accessKey String 访问密钥 ID
secretKey String 密钥,查询时脱敏返回
region String 地域。示例值:gz
bucket String 存储桶名称

AccessControl

请求头及 URL 访问控制。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
accessControlRules [AccessControlRule] 访问控制规则
returnCode Integer 命中后返回的状态码。示例值:403

AccessControlRule

一条访问控制规则。

参数名称 必选 类型 描述
ruleType String 规则类型。取值:requestHeader(请求头)、url(访问 URL)。示例值:requestHeader
ruleContent String 封禁内容。示例值:example
regex String 匹配方式。取值:on(正则)、off(字面)。示例值:off
ruleHeader String ruleTyperequestHeader 时必填。示例值:X-Rule

UrlRedirect

访问 URL 重写。switchonpathRules 必填,最多 10 条。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
pathRules [UrlRedirectRule] URL 重写规则

UrlRedirectRule

一条 URL 重写规则。

参数名称 必选 类型 描述
redirectStatusCode Integer 重定向状态码。取值:301302。示例值:302
pattern String 待匹配 URL 路径,不支持参数;支持最多 5 个 *,最长 1024 字符
redirectUrl String 目标路径,须以 / 开头,不含参数;可用 $1$5 捕获通配符
redirectHost String 目标 Host,须以 http://https:// 开头;不填则为 http:// + 当前域名
fullMatch Boolean 是否全路径匹配。示例值:false
regex Boolean pattern 是否按正则匹配。示例值:false

AdvancedAuthentication

时间戳防盗链高级版(白名单)。开启时必须且只配置一种模式,其余模式置为 null

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
typeA AdvancedAuthenticationTypeA 模式 A
typeB AdvancedAuthenticationTypeB 模式 B
typeC AdvancedAuthenticationTypeC 模式 C
typeD AdvancedAuthenticationTypeD 模式 D
typeE AdvancedAuthenticationTypeE 模式 E
typeF AdvancedAuthenticationTypeF 模式 F

AdvancedAuthenticationTypeA

高级防盗链模式 A。

参数名称 必选 类型 描述
secretKey String 签名密钥,字母和数字,长度 6–32
signParam String URI 中签名字段名,须以字母开头。示例值:sign
timeParam String URI 中时间字段名,须以字母开头。示例值:t
expireTime Integer 过期时间,单位秒。示例值:0
expireTimeRequired Boolean 是否必须提供过期时间。示例值:false
format String URL 组成格式。示例值:${private_key}${schema}${host}${full_uri}
timeFormat String 时间格式。取值:dec(十进制)、hex(十六进制)。示例值:dec
failCode Integer 鉴权失败状态码。示例值:403
expireCode Integer 链接过期状态码。示例值:403
rulePaths Array of String 需鉴权的 URL 路径。示例值:["/data"]

AdvancedAuthenticationTypeB

高级防盗链模式 B。

参数名称 必选 类型 描述
keyAlpha String Alpha 密钥
keyBeta String Beta 密钥
keyGamma String Gamma 密钥
signParam String 签名字段名。示例值:sign
timeParam String 时间字段名。示例值:t
expireTime Integer 过期时间,单位秒。示例值:3600
timeFormat String 时间格式。取值:dechex。示例值:dec
failCode Integer 鉴权失败状态码。示例值:403
expireCode Integer 链接过期状态码。示例值:410
rulePaths Array of String 需鉴权的 URL 路径。示例值:["/data"]

AdvancedAuthenticationTypeC

高级防盗链模式 C。

参数名称 必选 类型 描述
accessKey String 访问密钥
secretKey String 鉴权密钥

AdvancedAuthenticationTypeD

高级防盗链模式 D。

参数名称 必选 类型 描述
secretKey String 签名密钥,字母和数字,长度 6–32
backupSecretKey String 备用密钥,主密钥失败时使用
signParam String 签名字段名。示例值:signature
timeParam String 时间字段名。示例值:timestamp
expireTime Integer 过期时间,单位秒。示例值:1800
timeFormat String 时间格式。取值:dechex。示例值:hex

AdvancedAuthenticationTypeE

高级防盗链模式 E。

参数名称 必选 类型 描述
secretKey String 签名密钥,字母和数字,长度 6–32
signParam String 签名字段名
aclSignParam String ACL 签名字段名
startTimeParam String 开始时间字段名
expireTimeParam String 过期时间字段名
timeFormat String 时间格式。取值:dec。示例值:dec

AdvancedAuthenticationTypeF

高级防盗链模式 F。

参数名称 必选 类型 描述
signParam String 签名字段名
timeParam String 时间字段名
transactionParam String Transaction 字段名
secretKey String 主密钥,字母和数字,长度 6–32
backupSecretKey String 备用密钥,主密钥失败时再试

OriginAuthentication

回源鉴权高级版(白名单)。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
typeA OriginAuthenticationTypeA 鉴权类型 A

OriginAuthenticationTypeA

回源鉴权类型 A。

参数名称 必选 类型 描述
secretKey String 签名密钥,字母和数字,长度 6–32

OfflineCache

离线缓存。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off

PostSize

POST 请求上传文件流式传输上限。关闭时平台默认 32 MB。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
maxSize Integer 上限,单位 MB,取值 1~200。示例值:32

Quic

QUIC 访问(收费服务)。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off

OssPrivateAccess

OSS 回源鉴权。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
accessKey String 访问密钥 ID
secretKey String 密钥,查询时脱敏返回
region String 地域。示例值:gz
bucket String 存储桶名称

WebSocket

WebSocket 超时。关闭时平台仍支持连接,超时默认 15 秒。

参数名称 必选 类型 描述
switch String 开关。取值:on(可调超时)、off(关闭)。示例值:off
timeout Integer 超时时间,单位秒,最大 300。示例值:10

RemoteAuthentication

远程鉴权。remoteAuthenticationRulesserver 互斥,只配其中一个。仅配 server 时,规则项使用默认值。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
remoteAuthenticationRules [RemoteAuthenticationRule] 远程鉴权规则
server String 远程鉴权服务地址。示例值:http://auth.example.com/a.php

RemoteAuthenticationRule

一条远程鉴权规则。

参数名称 必选 类型 描述
server String 远程鉴权地址。默认值:与上层 server 一致
authMethod String 请求鉴权服务的 HTTP 方法。取值:getpostheadall(跟随用户)。默认值:all。示例值:get
ruleType String 规则类型。取值:allfiledirectorypath。默认值:all。示例值:file
rulePaths Array of String 匹配内容。all*filejpg。默认值:["*"]。示例值:["jpg"]
authTimeout Integer 超时,单位毫秒,范围 1~30000。默认值:20000。示例值:20000
authTimeoutAction String 超时动作。取值:RETURN_200(放行)、RETURN_403(拦截)。默认值:RETURN_200

ShareCname

共享 CNAME(内测,需开白)。

参数名称 必选 类型 描述
switch String 开关。取值:on(使用共享 CNAME)、off(使用默认 CNAME)。示例值:off
cname String 共享 CNAME。示例值:mycname-12345.shared.cdn.dnsv1.com

HwPrivateAccess

华为云对象存储回源鉴权。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
accessKey String 访问密钥 ID
secretKey String 密钥,查询时脱敏返回
bucket String 存储桶名称

QnPrivateAccess

七牛云对象存储回源鉴权。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
accessKey String 访问密钥 ID
secretKey String 密钥,查询时脱敏返回

OthersPrivateAccess

其他厂商对象存储回源鉴权。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
accessKey String 访问密钥 ID
secretKey String 密钥,查询时脱敏返回
region String 地域。示例值:gz
bucket String 存储桶名称

HttpsBilling

HTTPS 服务。关闭后将拦截 HTTPS 请求;开启会产生计费。缺省时默认开启。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启并计费)、off(关闭并拦截 HTTPS)。示例值:on

ParamFilter

参数黑名单。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
filterRules [ParamFilterRule] 参数黑名单规则

ParamFilterRule

一条参数黑名单规则。values 少于 10 个。

参数名称 必选 类型 描述
key String 参数名。示例值:exampleParam
values Array of String 参数值列表。示例值:["blacklistValue1"]
returnCode String HTTP 返回码,暂仅支持 403。示例值:403

AutoGuard

流量防盗刷(仅中国境内)。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:off
filterRules [FilterRules] 防盗刷规则

FilterRules

一条流量防盗刷规则。

参数名称 必选 类型 描述
filterType String 封禁类型。取值:forbidden(封禁)。示例值:forbidden
ruleType String 规则类型。取值:all(全部请求)、file(指定后缀)。示例值:all
rulePaths Array of String 封禁路径。示例值:["*"]

GeoBlocker

区域访问控制,默认为关闭。

参数名称 必选 类型 描述
switch String 开关。取值:on(开启)、off(关闭)。示例值:on
blockRules [GeoBlockStrategy] 区域访问规则

GeoBlockStrategy

一条区域访问控制规则。

参数名称 必选 类型 描述
blockType String 名单类型。取值:whitelist(白名单)、blacklist(黑名单)。示例值:blacklist
ruleType String 生效类型。取值:all(全部)、directory(目录)。示例值:all
rulePaths Array of String 生效路径。all 时填 *。示例值:["*"]
districts Array of String 地区码,如 CN-GZCN-HKUS。示例值:["CN-HK"]