查询回源地址(新版)
更新时间:2025-01-23
接口描述
本接口用于查询指定加速域名的回源地址。
请求结构
GET /v2/domain/{domain}/config?originConfig HTTP/1.1
Host: cdn.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
URL参数
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
domain | string | 是 | 要查询的加速域名。 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
originConfig | list<OriginItem> | 源站地址列表。 |
OriginItem类型说明:
参数名称 | 类型 | 描述 |
---|---|---|
addr | string | 源站地址。 IPv4、IPv6 形式的 IP 地址,或者域名。 |
type | string | 源站类型。 |
httpPort | int | http 回源端口。默认80。 |
httpsPort | int | https 回源端口。默认443。 |
host | string | 回源时使用的 host 值。 |
upstreamProtocol | string | 回源协议。值为 http、https、*, 其中 * 表示协议跟随。 |
weight | int | 源站权重,值为1-100之间的整数。举例:按照权重分配回源的流量,假设某加速域名有两个源站,一个源站 A 权重是80,另一个 B 是20,总的回源量是1G,那么其中A源站大约会有800M的回源,B大约会有200M的回源。 |
backup | bool | 是否为备源站。true 表示备源站,false 表示主源站,默认为 false。 |
isp | string | 源站所属的运营商。值为un(联通)、ct(电信)、cm(移动)。 |
probeUrl | string | 探测地址。配置了 probeUrl,表明配置对源站进行应用层探测,百度智能云 CDN 会定期给源站发送 GET /{probeUrl} 请求进行探测,如果源站响应的 HTTP 状态码小于500,那么认为源站正常;否则,认为源站异常,在探测恢复正常前不会选择异常源站进行回源。 |
请求示例
GET /v2/domain/myself.baidu.com/config?originConfig HTTP/1.1
Host: cdn.baidubce.com
Authorization: authorization string
响应示例
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
x-bce-request-id: dda1d6f6-66a4-a92-993a-1712b361bc7a
Server: nginx/1.16.1
{
"originConfig": [
{
"addr": "test1.com",
"type": "DOMAIN",
"weight": 10,
"host": "test1.baidu.com",
"backup": false,
"upstreamProtocol": "http"
},
{
"addr": "220.181.38.148",
"type": "IP",
"weight": 10,
"host": "test2.baidu.com",
"backup": true,
"upstreamProtocol": "*"
}
]
}