更新域名配置¶
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))
}
输出示例¶
示例2 关闭 HTTPS¶
输入示例¶
代码调用¶
请将 {登录域名}、token 替换为实际值。
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))
}
输出示例¶
5. 错误码¶
| HTTP 状态码 / 业务提示 | 描述 |
|---|---|
| 200 | 成功 |
| 401 | 未鉴权或 Token 无效 |
| 403 | 无权限 |
| 参数不能为空 | 未传请求体,或未传 request |
| 域名不能为空 | request.domain 为空 |
| 域名不属于你 | 指定域名未接入或不属于当前账号 |
| error code:{0},message:{1} | 上游更新失败,{0} 为错误码,{1} 为原因 |
6. 数据模型¶
已在 查询域名详细配置 展开的配置块(如 origin、cache、https)请点类型链接查看字段。本页补充其余配置块;更新复杂对象时须提交全部属性,未传属性将使用默认值。
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 | 用量提醒开关。取值:on、off。示例值:off |
| alertPercentage | 否 | Integer | 提醒百分比。示例值:80 |
| metric | 否 | String | 触发维度。取值:bandwidth(带宽)、flux(流量) |
| statisticItems | 否 | [StatisticItem] | 累计用量配置 |
StatisticItem¶
累计用量封顶项。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| switch | 否 | String | 开关。取值:on、off。示例值:on |
| type | 否 | String | 封顶类型。取值:total(累计)、moment(瞬时)。示例值:total |
| bpsThreshold | 否 | Integer | 带宽或流量阈值。示例值:1000000000 |
| counterMeasure | 否 | String | 关闭方式。取值:RETURN_404 |
| metric | 否 | String | 指标。取值:flux、bandwidth。示例值:flux |
| cycle | 否 | Integer | 检测周期,单位分钟。取值:60、1440。示例值:60 |
| unBlockTime | 否 | Integer | 自动解封时间。示例值:60 |
| alertSwitch | 否 | String | 告警开关。取值:on、off |
| alertPercentage | 否 | Integer | 提醒百分比。示例值:80 |
FollowRedirect¶
回源 301/302 自动跟随,默认为关闭。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| switch | 是 | String | 开关。取值:on(开启)、off(关闭)。示例值:off |
| redirectConfig | 否 | RedirectConfig | 自定义 follow 请求 Host(白名单功能) |
RedirectConfig¶
自定义回源 302 follow 的 Host。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| switch | 是 | String | 开关。取值:on、off。示例值: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 | ruleType 为 requestHeader 时必填。示例值:X-Rule |
UrlRedirect¶
访问 URL 重写。switch 为 on 时 pathRules 必填,最多 10 条。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| switch | 是 | String | 开关。取值:on(开启)、off(关闭)。示例值:off |
| pathRules | 否 | [UrlRedirectRule] | URL 重写规则 |
UrlRedirectRule¶
一条 URL 重写规则。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| redirectStatusCode | 是 | Integer | 重定向状态码。取值:301、302。示例值: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 | 时间格式。取值:dec、hex。示例值: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 | 时间格式。取值:dec、hex。示例值: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¶
远程鉴权。remoteAuthenticationRules 与 server 互斥,只配其中一个。仅配 server 时,规则项使用默认值。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| switch | 是 | String | 开关。取值:on(开启)、off(关闭)。示例值:on |
| remoteAuthenticationRules | 否 | [RemoteAuthenticationRule] | 远程鉴权规则 |
| server | 否 | String | 远程鉴权服务地址。示例值:http://auth.example.com/a.php |
RemoteAuthenticationRule¶
一条远程鉴权规则。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| server | 是 | String | 远程鉴权地址。默认值:与上层 server 一致 |
| authMethod | 是 | String | 请求鉴权服务的 HTTP 方法。取值:get、post、head、all(跟随用户)。默认值:all。示例值:get |
| ruleType | 是 | String | 规则类型。取值:all、file、directory、path。默认值:all。示例值:file |
| rulePaths | 是 | Array of String | 匹配内容。all 填 *,file 填 jpg。默认值:["*"]。示例值:["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-GZ、CN-HK、US。示例值:["CN-HK"] |