itecdn 5.x用户文档
itecdn 5.x / 用户 API

批量更新网站

PUT/v1/sites

批量更新网站配置。请求体可为单个对象或对象数组;单个对象会被转换为数组处理。每个对象必须包含已有网站的 id,仅传入需要修改的字段。普通用户只能更新自己的网站;管理员才能修改其他用户网站、归属用户、套餐、区域、线路和 CNAME 相关字段。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

未定义路径、查询或请求头参数。

请求体 · 必填

application/json

oneOf

oneOf · 1 · object

单个网站更新对象。

字段类型必填说明与约束
idinteger必填

必填。要更新的网站 ID,必须存在且当前用户有权限操作。

约束 / 默认值 / 示例
{
  "minimum": 1
}
domainstring可选

网站域名,多个域名以空白字符分隔;会转为小写且不得重复。修改后重新校验套餐配额、区域内域名和域名端口唯一性。

backendarray <object>可选

源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 up 状态源站。

展开字段结构

源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 up 状态源站。

数组元素 · object
字段类型必填说明与约束
addrstring必填

源站地址。

weightinteger必填

源站权重。

约束 / 默认值 / 示例
{
  "minimum": 1,
  "maximum": 10
}
statestring必填

源站状态。

约束 / 默认值 / 示例
{
  "enum": [
    "up",
    "down",
    "backup"
  ]
}
user_packageinteger可选

用户套餐 ID;必须属于网站归属用户且可用。变更套餐会重新同步相关线路与配置。

new_uidinteger可选

管理员专用。将网站转移到指定用户;同时必须传入 user_package。

uidinteger可选

管理员专用。指定本次套餐与资源校验所使用的用户 ID。

http_listenobject可选

HTTP 监听配置;与 HTTPS 至少保留一个。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

HTTP 监听配置;与 HTTPS 至少保留一个。

字段类型必填说明与约束
portstring可选

空白分隔的监听端口;每个端口必须有效、未占用且在区域允许范围内。

https_listenobject可选

HTTPS 监听配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

HTTPS 监听配置。

字段类型必填说明与约束
portstring可选

空白分隔的 HTTPS 监听端口。

certinteger可选

已启用证书 ID。

hstsinteger可选

是否启用 HSTS。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
http2integer可选

是否启用 HTTP/2。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
http3integer可选

是否启用 HTTP/3。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
ocsp_staplinginteger可选

是否启用 OCSP Stapling。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
force_ssl_enableinteger可选

是否强制跳转 HTTPS。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
force_ssl_portstring可选

强制跳转目标端口,必须在 HTTPS 监听端口中。

ssl_protocolsstring可选

允许的 TLS 协议,使用空白字符分隔。

ssl_ciphersstring可选

TLS 密码套件。

ssl_prefer_server_ciphersstring可选

是否优先使用服务端密码套件。

约束 / 默认值 / 示例
{
  "enum": [
    "on",
    "off"
  ]
}
balance_waystring可选

负载均衡方式。ip_hash 不支持备用源站。

约束 / 默认值 / 示例
{
  "enum": [
    "ip_hash",
    "rr"
  ]
}
backend_protocolstring可选

回源协议。

约束 / 默认值 / 示例
{
  "enum": [
    "follow",
    "http",
    "https"
  ]
}
backend_http_portinteger可选

HTTP 回源端口。

backend_https_portinteger可选

HTTPS 回源端口。

backend_port_mappinginteger可选

是否使用访问端口作为回源端口。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
proxy_timeoutinteger可选

回源读取超时,单位秒。

约束 / 默认值 / 示例
{
  "maximum": 86400
}
proxy_connect_timeoutinteger可选

回源连接超时,单位秒。

约束 / 默认值 / 示例
{
  "maximum": 75
}
health_checkobject可选

健康检查配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

健康检查配置。

字段类型必填说明与约束
enableinteger可选

是否启用健康检查。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
hoststring可选

检查请求域名。

pathstring可选

检查路径,必须以 / 开头。

proxy_authobject可选

回源认证配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

回源认证配置。

字段类型必填说明与约束
enableboolean可选

是否启用认证。

usernamestring可选

认证用户名。

passwordstring可选

认证密码。

proxy_cacheinteger可选

是否启用代理缓存。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
gzip_enableinteger可选

是否启用 Gzip。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
gzip_typesstring可选

Gzip MIME 类型。

websocket_enableinteger可选

是否启用 WebSocket 代理。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
enableinteger可选

网站启用状态。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
statestring可选

网站处理状态。

cname_modestring可选

CNAME 使用方式;切换会触发相应同步任务。

约束 / 默认值 / 示例
{
  "enum": [
    "package",
    "site"
  ]
}
cname_domaininteger可选

管理员专用。CNAME 域名配置 ID。

cname_hostnamestring可选

管理员专用。网站 CNAME 主机名,必须唯一且合法。

region_idinteger可选

管理员专用。区域 ID。

node_group_idinteger可选

管理员专用。主线路组 ID;CNAME 按套餐时不能单独修改。

backup_node_groupinteger可选

管理员专用。备用线路组 ID;不能与主线路组相同。

约束 / 默认值 / 示例
{
  "nullable": true
}
aclinteger可选

ACL ID;传 null 或 0 表示不绑定。ACL 必须已启用且属于当前目标用户,否则要求管理员权限。

约束 / 默认值 / 示例
{
  "example": 12,
  "minimum": 0,
  "nullable": true
}
acme_proxy_to_orgininteger可选

是否将 /.well-known/acme-challenge/ 请求回源:1 开启,0 关闭。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
backend_hoststring可选

回源 Host。允许 $host、$host:$server_port,或合法域名/IP及可选端口。

约束 / 默认值 / 示例
{
  "example": "$host"
}
black_ipstring可选

网站黑名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。

约束 / 默认值 / 示例
{
  "example": "198.51.100.0/24"
}
block_proxyinteger可选

是否拦截被识别为代理的客户端。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
block_regionstring可选

按两字母小写国家/地区代码拦截,多个值以逗号分隔;空字符串表示关闭。

约束 / 默认值 / 示例
{
  "example": "us,jp",
  "pattern": "^$|^[a-z]{2}(,[a-z]{2})*$"
}
block_timeinteger可选

自动黑名单持续时间,单位秒;非空时必须大于 600 且不超过 604800。

约束 / 默认值 / 示例
{
  "example": 3600,
  "minimum": 601,
  "maximum": 604800
}
cc_default_ruleinteger可选

默认 CC 规则 ID;规则必须存在且启用,使用其他用户的非内置规则需要管理员权限。

约束 / 默认值 / 示例
{
  "example": 10002,
  "minimum": 1
}
cc_switchobject可选

CC 规则自动切换配置;空对象表示关闭。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "rule",
    "switch"
  ],
  "example": {
    "rule": 10002,
    "switch": 100,
    "enable": 1
  }
}
展开字段结构

CC 规则自动切换配置;空对象表示关闭。

字段类型必填说明与约束
ruleinteger必填

切换后的 CC 规则 ID。

约束 / 默认值 / 示例
{
  "example": 10002,
  "minimum": 1
}
switchinteger必填

触发切换的请求阈值。

约束 / 默认值 / 示例
{
  "example": 100,
  "minimum": 0
}
enableinteger可选

是否启用自动切换。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
condition_backendarray <object>可选

按请求条件选择源站的规则列表。

约束 / 默认值 / 示例
{
  "example": [
    {
      "matcher": [
        {
          "item": "req_uri",
          "op": "contain",
          "value": "/api/"
        }
      ],
      "backend": [
        {
          "addr": "198.51.100.10",
          "weight": 1,
          "state": "up"
        }
      ]
    }
  ]
}
展开字段结构

按请求条件选择源站的规则列表。

数组元素 · object
字段类型必填说明与约束
matcherarray <object>必填

全部匹配条件。

约束 / 默认值 / 示例
{
  "minItems": 1
}
展开字段结构

全部匹配条件。

数组元素 · object

匹配条件。

字段类型必填说明与约束
itemstring必填

匹配项。

约束 / 默认值 / 示例
{
  "example": "req_uri"
}
opstring必填

匹配操作符。

约束 / 默认值 / 示例
{
  "example": "contain",
  "enum": [
    ">",
    "=",
    "!=",
    "contain",
    "!contain",
    "prefix",
    "suffix",
    "regex",
    "!regex",
    "exists",
    "!exists",
    "ip_range",
    "!ip_range"
  ]
}
valuestring必填

匹配值;服务端会去除空行和首尾空白。

约束 / 默认值 / 示例
{
  "example": "/api/"
}
backendarray <object>必填

命中后使用的源站列表。

约束 / 默认值 / 示例
{
  "minItems": 1
}
展开字段结构

命中后使用的源站列表。

数组元素 · object

条件命中时使用的源站。

字段类型必填说明与约束
addrstring必填

源站 IPv4、IPv6 或域名。

约束 / 默认值 / 示例
{
  "example": "198.51.100.10"
}
weightinteger可选

源站权重。

约束 / 默认值 / 示例
{
  "example": 1,
  "minimum": 1,
  "maximum": 10
}
statestring可选

源站状态。

约束 / 默认值 / 示例
{
  "example": "up",
  "enum": [
    "up",
    "down",
    "backup"
  ]
}
cookie_domainstring可选

Cookie Domain;允许空字符串,非空时必须是合法域名。

约束 / 默认值 / 示例
{
  "example": "example.invalid"
}
corsobject可选

跨域响应配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "enable",
    "allow_origin",
    "allow_methods",
    "allow_headers",
    "expose_headers",
    "allow_credentials",
    "max_age"
  ],
  "example": {
    "enable": 1,
    "allow_origin": "*",
    "allow_methods": "GET POST OPTIONS",
    "allow_headers": "Content-Type",
    "expose_headers": "Content-Length",
    "allow_credentials": 0,
    "max_age": "1728000"
  }
}
展开字段结构

跨域响应配置。

字段类型必填说明与约束
enableinteger必填

是否启用 CORS。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
allow_originstring必填

Access-Control-Allow-Origin 值。

约束 / 默认值 / 示例
{
  "example": "*"
}
allow_methodsstring必填

允许的方法,空格分隔。

约束 / 默认值 / 示例
{
  "example": "GET POST OPTIONS"
}
allow_headersstring必填

允许的请求头,空格分隔。

约束 / 默认值 / 示例
{
  "example": "Content-Type Authorization"
}
expose_headersstring必填

允许浏览器读取的响应头。

约束 / 默认值 / 示例
{
  "example": "Content-Length"
}
allow_credentialsinteger必填

是否允许携带凭证。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
max_agestring必填

预检结果缓存秒数;服务端要求传数字字符串。

约束 / 默认值 / 示例
{
  "example": "1728000",
  "pattern": "^\\d+$"
}
dns_apiinteger可选

DNS API 凭据 ID;必须属于目标用户。传 null 表示不绑定。

约束 / 默认值 / 示例
{
  "example": 8,
  "minimum": 1,
  "nullable": true
}
enable_ipv6integer可选

是否启用 IPv6 CNAME;仅按网站生成 CNAME 且系统存在 IPv6 节点时可用。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
extra_cc_rulearray <object>可选

网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。

约束 / 默认值 / 示例
{
  "example": [
    {
      "matcher": {
        "req_uri": {
          "operator": "contain",
          "value": "/api/"
        }
      },
      "filter": {
        "type": "req_rate",
        "within_second": 10,
        "max_req": 60
      }
    }
  ]
}
展开字段结构

网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。

数组元素 · object

一条自定义 CC 规则,包含 matcher 与 filter 配置。

groupsstring可选

网站分组 ID,多个 ID 使用逗号分隔;空字符串表示不加入分组。

约束 / 默认值 / 示例
{
  "example": "3,8",
  "pattern": "^$|^\\d+(,\\d+)*$"
}
hotlinkobject可选

防盗链配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "enable",
    "domain",
    "allow_empty"
  ],
  "example": {
    "enable": 1,
    "domain": "www.example.invalid",
    "allow_empty": 0,
    "scope_type": "all",
    "scope_content": ""
  }
}
展开字段结构

防盗链配置。

字段类型必填说明与约束
enableinteger必填

是否启用防盗链。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
domainstring必填

允许的来源域名,使用空格分隔;空值仅允许本站域名。

约束 / 默认值 / 示例
{
  "example": "www.example.invalid"
}
allow_emptyinteger必填

是否允许空 Referer。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
scope_typestring可选

生效范围。

约束 / 默认值 / 示例
{
  "example": "all",
  "enum": [
    "all",
    "suffix",
    "dir",
    "full_path"
  ]
}
scope_contentstring可选

非 all 范围的匹配内容。

约束 / 默认值 / 示例
{
  "example": "/static/"
}
is_default_serverinteger可选

管理员专用。是否作为线路范围内的默认站点;同一节点的监听端口不能与其它默认站点冲突。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
l2_config_idinteger可选

管理员专用。L2 配置 ID;必须存在、与网站区域一致并已绑定 L2 节点。

约束 / 默认值 / 示例
{
  "example": 9,
  "minimum": 1
}
l2_statestring可选

管理员专用。L2 模式。

约束 / 默认值 / 示例
{
  "example": "inherit",
  "enum": [
    "off",
    "inherit",
    "custom"
  ]
}
log_req_bodyinteger可选

管理员专用。是否记录请求体。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
log_req_body_max_sizeinteger可选

管理员专用。记录请求体的最大 KiB;不能超过 2048,也不能超过全局 client_body_buffer_size。

约束 / 默认值 / 示例
{
  "example": 16,
  "minimum": 0,
  "maximum": 2048
}
log_req_headerinteger可选

管理员专用。是否记录请求头。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
log_resp_headerinteger可选

管理员专用。是否记录响应头。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
page_403string可选

自定义 403 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Forbidden</h1>"
}
page_404string可选

自定义 404 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Not Found</h1>"
}
page_500string可选

自定义 500 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Server Error</h1>"
}
page_502string可选

自定义 502 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Bad Gateway</h1>"
}
page_504string可选

自定义 504 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Gateway Timeout</h1>"
}
post_size_limitstring可选

POST 请求体大小限制。可使用纯数字或 b/k/m/g 单位,大小写均可;空字符串表示采用默认配置。

约束 / 默认值 / 示例
{
  "example": "10m",
  "pattern": "^$|^\\d+(?:[bBkKmMgG])?$"
}
proxy_http_versionstring可选

回源 HTTP 协议版本。

约束 / 默认值 / 示例
{
  "example": "1.1",
  "enum": [
    "1.0",
    "1.1"
  ]
}
proxy_ssl_protocolsstring可选

允许的回源 TLS/SSL 协议,多个值使用空格分隔。

约束 / 默认值 / 示例
{
  "example": "TLSv1.2 TLSv1.3",
  "pattern": "^(?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3)(?: (?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3))*$"
}
rangeinteger可选

是否启用分段回源。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
recv_real_timeinteger可选

是否实时向客户端返回上游响应数据。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
req_headerarray <object>可选

添加或覆盖的回源请求头。

约束 / 默认值 / 示例
{
  "example": [
    {
      "name": "X-Origin",
      "value": "itecdn"
    }
  ]
}
展开字段结构

添加或覆盖的回源请求头。

数组元素 · object
字段类型必填说明与约束
namestring必填

请求头名称,必须以英文字母开头。

约束 / 默认值 / 示例
{
  "example": "X-Example"
}
valuestring必填

请求头值,去除首尾空白后不能为空。

约束 / 默认值 / 示例
{
  "example": "example-value"
}
resp_headerarray <object>可选

添加或覆盖的客户端响应头。

约束 / 默认值 / 示例
{
  "example": [
    {
      "name": "X-Cache",
      "value": "itecdn"
    }
  ]
}
展开字段结构

添加或覆盖的客户端响应头。

数组元素 · object
字段类型必填说明与约束
namestring必填

请求头名称,必须以英文字母开头。

约束 / 默认值 / 示例
{
  "example": "X-Example"
}
valuestring必填

请求头值,去除首尾空白后不能为空。

约束 / 默认值 / 示例
{
  "example": "example-value"
}
send_real_timeinteger可选

是否实时向上游发送客户端请求数据。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
spider_allowstring可选

搜索引擎爬虫访问策略;空字符串表示不单独设置。

约束 / 默认值 / 示例
{
  "example": "allow",
  "enum": [
    "",
    "allow",
    "deny"
  ]
}
spider_to_sipstring可选

搜索引擎专用回源 IP;空字符串表示关闭。仅按网站生成 CNAME 且 DNS 服务支持对应线路时可用。

约束 / 默认值 / 示例
{
  "example": "198.51.100.20"
}
ups_keepaliveinteger可选

是否启用上游 Keepalive。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
ups_keepalive_conninteger可选

每个 worker 保留的上游 Keepalive 连接数。

约束 / 默认值 / 示例
{
  "example": 16,
  "minimum": 1,
  "maximum": 100
}
ups_keepalive_timeoutinteger可选

上游 Keepalive 空闲超时秒数。

约束 / 默认值 / 示例
{
  "example": 60,
  "minimum": 0
}
url_rewritearray <object>可选

URL 重定向规则。

约束 / 默认值 / 示例
{
  "example": [
    {
      "host": "www.example.invalid",
      "match": "/(.*)",
      "redirect": "https://example.invalid/$1",
      "code": "301"
    }
  ]
}
展开字段结构

URL 重定向规则。

数组元素 · object
字段类型必填说明与约束
hoststring必填

匹配 Host,不含 http:// 或 https://。

约束 / 默认值 / 示例
{
  "example": "www.example.invalid"
}
matchstring必填

URI 匹配表达式。

约束 / 默认值 / 示例
{
  "example": "/(.*)"
}
redirectstring必填

重定向目标;可使用 $1 或受支持的 Nginx 变量。

约束 / 默认值 / 示例
{
  "example": "https://example.invalid/$1"
}
codestring必填

重定向方式。

约束 / 默认值 / 示例
{
  "example": "301",
  "enum": [
    "301",
    "302",
    "307",
    "internal"
  ]
}
user_agentstring可选

User-Agent 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
refererstring可选

Referer 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
country_codestring可选

国家代码匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
accept_languagestring可选

Accept-Language 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
provincestring可选

省份匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
citystring可选

城市匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
ispstring可选

运营商匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
asnumberstring可选

ASN 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
white_ipstring可选

网站白名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。

约束 / 默认值 / 示例
{
  "example": "203.0.113.10"
}
white_timeinteger可选

自动白名单持续时间,单位秒;非空时不超过 604800。

约束 / 默认值 / 示例
{
  "example": 3600,
  "minimum": 0,
  "maximum": 604800
}
oneOf · 2 · array <object>

批量更新对象数组;每个元素独立按相同规则校验和更新。

数组元素 · object
字段类型必填说明与约束
idinteger必填

必填。要更新的网站 ID,必须存在且当前用户有权限操作。

约束 / 默认值 / 示例
{
  "minimum": 1
}
domainstring可选

网站域名,多个域名以空白字符分隔;会转为小写且不得重复。修改后重新校验套餐配额、区域内域名和域名端口唯一性。

backendarray <object>可选

源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 up 状态源站。

展开字段结构

源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 up 状态源站。

数组元素 · object
字段类型必填说明与约束
addrstring必填

源站地址。

weightinteger必填

源站权重。

约束 / 默认值 / 示例
{
  "minimum": 1,
  "maximum": 10
}
statestring必填

源站状态。

约束 / 默认值 / 示例
{
  "enum": [
    "up",
    "down",
    "backup"
  ]
}
user_packageinteger可选

用户套餐 ID;必须属于网站归属用户且可用。变更套餐会重新同步相关线路与配置。

new_uidinteger可选

管理员专用。将网站转移到指定用户;同时必须传入 user_package。

uidinteger可选

管理员专用。指定本次套餐与资源校验所使用的用户 ID。

http_listenobject可选

HTTP 监听配置;与 HTTPS 至少保留一个。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

HTTP 监听配置;与 HTTPS 至少保留一个。

字段类型必填说明与约束
portstring可选

空白分隔的监听端口;每个端口必须有效、未占用且在区域允许范围内。

https_listenobject可选

HTTPS 监听配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

HTTPS 监听配置。

字段类型必填说明与约束
portstring可选

空白分隔的 HTTPS 监听端口。

certinteger可选

已启用证书 ID。

hstsinteger可选

是否启用 HSTS。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
http2integer可选

是否启用 HTTP/2。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
http3integer可选

是否启用 HTTP/3。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
ocsp_staplinginteger可选

是否启用 OCSP Stapling。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
force_ssl_enableinteger可选

是否强制跳转 HTTPS。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
force_ssl_portstring可选

强制跳转目标端口,必须在 HTTPS 监听端口中。

ssl_protocolsstring可选

允许的 TLS 协议,使用空白字符分隔。

ssl_ciphersstring可选

TLS 密码套件。

ssl_prefer_server_ciphersstring可选

是否优先使用服务端密码套件。

约束 / 默认值 / 示例
{
  "enum": [
    "on",
    "off"
  ]
}
balance_waystring可选

负载均衡方式。ip_hash 不支持备用源站。

约束 / 默认值 / 示例
{
  "enum": [
    "ip_hash",
    "rr"
  ]
}
backend_protocolstring可选

回源协议。

约束 / 默认值 / 示例
{
  "enum": [
    "follow",
    "http",
    "https"
  ]
}
backend_http_portinteger可选

HTTP 回源端口。

backend_https_portinteger可选

HTTPS 回源端口。

backend_port_mappinginteger可选

是否使用访问端口作为回源端口。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
proxy_timeoutinteger可选

回源读取超时,单位秒。

约束 / 默认值 / 示例
{
  "maximum": 86400
}
proxy_connect_timeoutinteger可选

回源连接超时,单位秒。

约束 / 默认值 / 示例
{
  "maximum": 75
}
health_checkobject可选

健康检查配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

健康检查配置。

字段类型必填说明与约束
enableinteger可选

是否启用健康检查。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
hoststring可选

检查请求域名。

pathstring可选

检查路径,必须以 / 开头。

proxy_authobject可选

回源认证配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false
}
展开字段结构

回源认证配置。

字段类型必填说明与约束
enableboolean可选

是否启用认证。

usernamestring可选

认证用户名。

passwordstring可选

认证密码。

proxy_cacheinteger可选

是否启用代理缓存。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
gzip_enableinteger可选

是否启用 Gzip。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
gzip_typesstring可选

Gzip MIME 类型。

websocket_enableinteger可选

是否启用 WebSocket 代理。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
enableinteger可选

网站启用状态。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
statestring可选

网站处理状态。

cname_modestring可选

CNAME 使用方式;切换会触发相应同步任务。

约束 / 默认值 / 示例
{
  "enum": [
    "package",
    "site"
  ]
}
cname_domaininteger可选

管理员专用。CNAME 域名配置 ID。

cname_hostnamestring可选

管理员专用。网站 CNAME 主机名,必须唯一且合法。

region_idinteger可选

管理员专用。区域 ID。

node_group_idinteger可选

管理员专用。主线路组 ID;CNAME 按套餐时不能单独修改。

backup_node_groupinteger可选

管理员专用。备用线路组 ID;不能与主线路组相同。

约束 / 默认值 / 示例
{
  "nullable": true
}
aclinteger可选

ACL ID;传 null 或 0 表示不绑定。ACL 必须已启用且属于当前目标用户,否则要求管理员权限。

约束 / 默认值 / 示例
{
  "example": 12,
  "minimum": 0,
  "nullable": true
}
acme_proxy_to_orgininteger可选

是否将 /.well-known/acme-challenge/ 请求回源:1 开启,0 关闭。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
backend_hoststring可选

回源 Host。允许 $host、$host:$server_port,或合法域名/IP及可选端口。

约束 / 默认值 / 示例
{
  "example": "$host"
}
black_ipstring可选

网站黑名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。

约束 / 默认值 / 示例
{
  "example": "198.51.100.0/24"
}
block_proxyinteger可选

是否拦截被识别为代理的客户端。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
block_regionstring可选

按两字母小写国家/地区代码拦截,多个值以逗号分隔;空字符串表示关闭。

约束 / 默认值 / 示例
{
  "example": "us,jp",
  "pattern": "^$|^[a-z]{2}(,[a-z]{2})*$"
}
block_timeinteger可选

自动黑名单持续时间,单位秒;非空时必须大于 600 且不超过 604800。

约束 / 默认值 / 示例
{
  "example": 3600,
  "minimum": 601,
  "maximum": 604800
}
cc_default_ruleinteger可选

默认 CC 规则 ID;规则必须存在且启用,使用其他用户的非内置规则需要管理员权限。

约束 / 默认值 / 示例
{
  "example": 10002,
  "minimum": 1
}
cc_switchobject可选

CC 规则自动切换配置;空对象表示关闭。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "rule",
    "switch"
  ],
  "example": {
    "rule": 10002,
    "switch": 100,
    "enable": 1
  }
}
展开字段结构

CC 规则自动切换配置;空对象表示关闭。

字段类型必填说明与约束
ruleinteger必填

切换后的 CC 规则 ID。

约束 / 默认值 / 示例
{
  "example": 10002,
  "minimum": 1
}
switchinteger必填

触发切换的请求阈值。

约束 / 默认值 / 示例
{
  "example": 100,
  "minimum": 0
}
enableinteger可选

是否启用自动切换。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
condition_backendarray <object>可选

按请求条件选择源站的规则列表。

约束 / 默认值 / 示例
{
  "example": [
    {
      "matcher": [
        {
          "item": "req_uri",
          "op": "contain",
          "value": "/api/"
        }
      ],
      "backend": [
        {
          "addr": "198.51.100.10",
          "weight": 1,
          "state": "up"
        }
      ]
    }
  ]
}
展开字段结构

按请求条件选择源站的规则列表。

数组元素 · object
字段类型必填说明与约束
matcherarray <object>必填

全部匹配条件。

约束 / 默认值 / 示例
{
  "minItems": 1
}
展开字段结构

全部匹配条件。

数组元素 · object

匹配条件。

字段类型必填说明与约束
itemstring必填

匹配项。

约束 / 默认值 / 示例
{
  "example": "req_uri"
}
opstring必填

匹配操作符。

约束 / 默认值 / 示例
{
  "example": "contain",
  "enum": [
    ">",
    "=",
    "!=",
    "contain",
    "!contain",
    "prefix",
    "suffix",
    "regex",
    "!regex",
    "exists",
    "!exists",
    "ip_range",
    "!ip_range"
  ]
}
valuestring必填

匹配值;服务端会去除空行和首尾空白。

约束 / 默认值 / 示例
{
  "example": "/api/"
}
backendarray <object>必填

命中后使用的源站列表。

约束 / 默认值 / 示例
{
  "minItems": 1
}
展开字段结构

命中后使用的源站列表。

数组元素 · object

条件命中时使用的源站。

字段类型必填说明与约束
addrstring必填

源站 IPv4、IPv6 或域名。

约束 / 默认值 / 示例
{
  "example": "198.51.100.10"
}
weightinteger可选

源站权重。

约束 / 默认值 / 示例
{
  "example": 1,
  "minimum": 1,
  "maximum": 10
}
statestring可选

源站状态。

约束 / 默认值 / 示例
{
  "example": "up",
  "enum": [
    "up",
    "down",
    "backup"
  ]
}
cookie_domainstring可选

Cookie Domain;允许空字符串,非空时必须是合法域名。

约束 / 默认值 / 示例
{
  "example": "example.invalid"
}
corsobject可选

跨域响应配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "enable",
    "allow_origin",
    "allow_methods",
    "allow_headers",
    "expose_headers",
    "allow_credentials",
    "max_age"
  ],
  "example": {
    "enable": 1,
    "allow_origin": "*",
    "allow_methods": "GET POST OPTIONS",
    "allow_headers": "Content-Type",
    "expose_headers": "Content-Length",
    "allow_credentials": 0,
    "max_age": "1728000"
  }
}
展开字段结构

跨域响应配置。

字段类型必填说明与约束
enableinteger必填

是否启用 CORS。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
allow_originstring必填

Access-Control-Allow-Origin 值。

约束 / 默认值 / 示例
{
  "example": "*"
}
allow_methodsstring必填

允许的方法,空格分隔。

约束 / 默认值 / 示例
{
  "example": "GET POST OPTIONS"
}
allow_headersstring必填

允许的请求头,空格分隔。

约束 / 默认值 / 示例
{
  "example": "Content-Type Authorization"
}
expose_headersstring必填

允许浏览器读取的响应头。

约束 / 默认值 / 示例
{
  "example": "Content-Length"
}
allow_credentialsinteger必填

是否允许携带凭证。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
max_agestring必填

预检结果缓存秒数;服务端要求传数字字符串。

约束 / 默认值 / 示例
{
  "example": "1728000",
  "pattern": "^\\d+$"
}
dns_apiinteger可选

DNS API 凭据 ID;必须属于目标用户。传 null 表示不绑定。

约束 / 默认值 / 示例
{
  "example": 8,
  "minimum": 1,
  "nullable": true
}
enable_ipv6integer可选

是否启用 IPv6 CNAME;仅按网站生成 CNAME 且系统存在 IPv6 节点时可用。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
extra_cc_rulearray <object>可选

网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。

约束 / 默认值 / 示例
{
  "example": [
    {
      "matcher": {
        "req_uri": {
          "operator": "contain",
          "value": "/api/"
        }
      },
      "filter": {
        "type": "req_rate",
        "within_second": 10,
        "max_req": 60
      }
    }
  ]
}
展开字段结构

网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。

数组元素 · object

一条自定义 CC 规则,包含 matcher 与 filter 配置。

groupsstring可选

网站分组 ID,多个 ID 使用逗号分隔;空字符串表示不加入分组。

约束 / 默认值 / 示例
{
  "example": "3,8",
  "pattern": "^$|^\\d+(,\\d+)*$"
}
hotlinkobject可选

防盗链配置。

约束 / 默认值 / 示例
{
  "additionalProperties": false,
  "required": [
    "enable",
    "domain",
    "allow_empty"
  ],
  "example": {
    "enable": 1,
    "domain": "www.example.invalid",
    "allow_empty": 0,
    "scope_type": "all",
    "scope_content": ""
  }
}
展开字段结构

防盗链配置。

字段类型必填说明与约束
enableinteger必填

是否启用防盗链。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
domainstring必填

允许的来源域名,使用空格分隔;空值仅允许本站域名。

约束 / 默认值 / 示例
{
  "example": "www.example.invalid"
}
allow_emptyinteger必填

是否允许空 Referer。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
scope_typestring可选

生效范围。

约束 / 默认值 / 示例
{
  "example": "all",
  "enum": [
    "all",
    "suffix",
    "dir",
    "full_path"
  ]
}
scope_contentstring可选

非 all 范围的匹配内容。

约束 / 默认值 / 示例
{
  "example": "/static/"
}
is_default_serverinteger可选

管理员专用。是否作为线路范围内的默认站点;同一节点的监听端口不能与其它默认站点冲突。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
l2_config_idinteger可选

管理员专用。L2 配置 ID;必须存在、与网站区域一致并已绑定 L2 节点。

约束 / 默认值 / 示例
{
  "example": 9,
  "minimum": 1
}
l2_statestring可选

管理员专用。L2 模式。

约束 / 默认值 / 示例
{
  "example": "inherit",
  "enum": [
    "off",
    "inherit",
    "custom"
  ]
}
log_req_bodyinteger可选

管理员专用。是否记录请求体。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
log_req_body_max_sizeinteger可选

管理员专用。记录请求体的最大 KiB;不能超过 2048,也不能超过全局 client_body_buffer_size。

约束 / 默认值 / 示例
{
  "example": 16,
  "minimum": 0,
  "maximum": 2048
}
log_req_headerinteger可选

管理员专用。是否记录请求头。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
log_resp_headerinteger可选

管理员专用。是否记录响应头。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
page_403string可选

自定义 403 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Forbidden</h1>"
}
page_404string可选

自定义 404 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Not Found</h1>"
}
page_500string可选

自定义 500 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Server Error</h1>"
}
page_502string可选

自定义 502 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Bad Gateway</h1>"
}
page_504string可选

自定义 504 错误页 HTML;空字符串使用默认页面。

约束 / 默认值 / 示例
{
  "example": "<h1>Gateway Timeout</h1>"
}
post_size_limitstring可选

POST 请求体大小限制。可使用纯数字或 b/k/m/g 单位,大小写均可;空字符串表示采用默认配置。

约束 / 默认值 / 示例
{
  "example": "10m",
  "pattern": "^$|^\\d+(?:[bBkKmMgG])?$"
}
proxy_http_versionstring可选

回源 HTTP 协议版本。

约束 / 默认值 / 示例
{
  "example": "1.1",
  "enum": [
    "1.0",
    "1.1"
  ]
}
proxy_ssl_protocolsstring可选

允许的回源 TLS/SSL 协议,多个值使用空格分隔。

约束 / 默认值 / 示例
{
  "example": "TLSv1.2 TLSv1.3",
  "pattern": "^(?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3)(?: (?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3))*$"
}
rangeinteger可选

是否启用分段回源。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
recv_real_timeinteger可选

是否实时向客户端返回上游响应数据。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
req_headerarray <object>可选

添加或覆盖的回源请求头。

约束 / 默认值 / 示例
{
  "example": [
    {
      "name": "X-Origin",
      "value": "itecdn"
    }
  ]
}
展开字段结构

添加或覆盖的回源请求头。

数组元素 · object
字段类型必填说明与约束
namestring必填

请求头名称,必须以英文字母开头。

约束 / 默认值 / 示例
{
  "example": "X-Example"
}
valuestring必填

请求头值,去除首尾空白后不能为空。

约束 / 默认值 / 示例
{
  "example": "example-value"
}
resp_headerarray <object>可选

添加或覆盖的客户端响应头。

约束 / 默认值 / 示例
{
  "example": [
    {
      "name": "X-Cache",
      "value": "itecdn"
    }
  ]
}
展开字段结构

添加或覆盖的客户端响应头。

数组元素 · object
字段类型必填说明与约束
namestring必填

请求头名称,必须以英文字母开头。

约束 / 默认值 / 示例
{
  "example": "X-Example"
}
valuestring必填

请求头值,去除首尾空白后不能为空。

约束 / 默认值 / 示例
{
  "example": "example-value"
}
send_real_timeinteger可选

是否实时向上游发送客户端请求数据。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
spider_allowstring可选

搜索引擎爬虫访问策略;空字符串表示不单独设置。

约束 / 默认值 / 示例
{
  "example": "allow",
  "enum": [
    "",
    "allow",
    "deny"
  ]
}
spider_to_sipstring可选

搜索引擎专用回源 IP;空字符串表示关闭。仅按网站生成 CNAME 且 DNS 服务支持对应线路时可用。

约束 / 默认值 / 示例
{
  "example": "198.51.100.20"
}
ups_keepaliveinteger可选

是否启用上游 Keepalive。

约束 / 默认值 / 示例
{
  "example": 1,
  "enum": [
    0,
    1
  ]
}
ups_keepalive_conninteger可选

每个 worker 保留的上游 Keepalive 连接数。

约束 / 默认值 / 示例
{
  "example": 16,
  "minimum": 1,
  "maximum": 100
}
ups_keepalive_timeoutinteger可选

上游 Keepalive 空闲超时秒数。

约束 / 默认值 / 示例
{
  "example": 60,
  "minimum": 0
}
url_rewritearray <object>可选

URL 重定向规则。

约束 / 默认值 / 示例
{
  "example": [
    {
      "host": "www.example.invalid",
      "match": "/(.*)",
      "redirect": "https://example.invalid/$1",
      "code": "301"
    }
  ]
}
展开字段结构

URL 重定向规则。

数组元素 · object
字段类型必填说明与约束
hoststring必填

匹配 Host,不含 http:// 或 https://。

约束 / 默认值 / 示例
{
  "example": "www.example.invalid"
}
matchstring必填

URI 匹配表达式。

约束 / 默认值 / 示例
{
  "example": "/(.*)"
}
redirectstring必填

重定向目标;可使用 $1 或受支持的 Nginx 变量。

约束 / 默认值 / 示例
{
  "example": "https://example.invalid/$1"
}
codestring必填

重定向方式。

约束 / 默认值 / 示例
{
  "example": "301",
  "enum": [
    "301",
    "302",
    "307",
    "internal"
  ]
}
user_agentstring可选

User-Agent 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
refererstring可选

Referer 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
country_codestring可选

国家代码匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
accept_languagestring可选

Accept-Language 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
provincestring可选

省份匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
citystring可选

城市匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
ispstring可选

运营商匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
asnumberstring可选

ASN 匹配;省略时为 .*。

约束 / 默认值 / 示例
{
  "example": ".*"
}
white_ipstring可选

网站白名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。

约束 / 默认值 / 示例
{
  "example": "203.0.113.10"
}
white_timeinteger可选

自动白名单持续时间,单位秒;非空时不超过 604800。

约束 / 默认值 / 示例
{
  "example": 3600,
  "minimum": 0,
  "maximum": 604800
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "description": "单个网站更新对象。",
      "additionalProperties": false,
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 1,
          "description": "必填。要更新的网站 ID,必须存在且当前用户有权限操作。"
        },
        "domain": {
          "type": "string",
          "description": "网站域名,多个域名以空白字符分隔;会转为小写且不得重复。修改后重新校验套餐配额、区域内域名和域名端口唯一性。"
        },
        "backend": {
          "type": "array",
          "description": "源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 `up` 状态源站。",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "addr",
              "weight",
              "state"
            ],
            "properties": {
              "addr": {
                "type": "string",
                "description": "源站地址。"
              },
              "weight": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10,
                "description": "源站权重。"
              },
              "state": {
                "type": "string",
                "enum": [
                  "up",
                  "down",
                  "backup"
                ],
                "description": "源站状态。"
              }
            }
          }
        },
        "user_package": {
          "type": "integer",
          "description": "用户套餐 ID;必须属于网站归属用户且可用。变更套餐会重新同步相关线路与配置。"
        },
        "new_uid": {
          "type": "integer",
          "description": "管理员专用。将网站转移到指定用户;同时必须传入 `user_package`。"
        },
        "uid": {
          "type": "integer",
          "description": "管理员专用。指定本次套餐与资源校验所使用的用户 ID。"
        },
        "http_listen": {
          "type": "object",
          "description": "HTTP 监听配置;与 HTTPS 至少保留一个。",
          "additionalProperties": false,
          "properties": {
            "port": {
              "type": "string",
              "description": "空白分隔的监听端口;每个端口必须有效、未占用且在区域允许范围内。"
            }
          }
        },
        "https_listen": {
          "type": "object",
          "description": "HTTPS 监听配置。",
          "additionalProperties": false,
          "properties": {
            "port": {
              "type": "string",
              "description": "空白分隔的 HTTPS 监听端口。"
            },
            "cert": {
              "type": "integer",
              "description": "已启用证书 ID。"
            },
            "hsts": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否启用 HSTS。"
            },
            "http2": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否启用 HTTP/2。"
            },
            "http3": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否启用 HTTP/3。"
            },
            "ocsp_stapling": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否启用 OCSP Stapling。"
            },
            "force_ssl_enable": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否强制跳转 HTTPS。"
            },
            "force_ssl_port": {
              "type": "string",
              "description": "强制跳转目标端口,必须在 HTTPS 监听端口中。"
            },
            "ssl_protocols": {
              "type": "string",
              "description": "允许的 TLS 协议,使用空白字符分隔。"
            },
            "ssl_ciphers": {
              "type": "string",
              "description": "TLS 密码套件。"
            },
            "ssl_prefer_server_ciphers": {
              "type": "string",
              "enum": [
                "on",
                "off"
              ],
              "description": "是否优先使用服务端密码套件。"
            }
          }
        },
        "balance_way": {
          "type": "string",
          "enum": [
            "ip_hash",
            "rr"
          ],
          "description": "负载均衡方式。`ip_hash` 不支持备用源站。"
        },
        "backend_protocol": {
          "type": "string",
          "enum": [
            "follow",
            "http",
            "https"
          ],
          "description": "回源协议。"
        },
        "backend_http_port": {
          "type": "integer",
          "description": "HTTP 回源端口。"
        },
        "backend_https_port": {
          "type": "integer",
          "description": "HTTPS 回源端口。"
        },
        "backend_port_mapping": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "是否使用访问端口作为回源端口。"
        },
        "proxy_timeout": {
          "type": "integer",
          "maximum": 86400,
          "description": "回源读取超时,单位秒。"
        },
        "proxy_connect_timeout": {
          "type": "integer",
          "maximum": 75,
          "description": "回源连接超时,单位秒。"
        },
        "health_check": {
          "type": "object",
          "description": "健康检查配置。",
          "additionalProperties": false,
          "properties": {
            "enable": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否启用健康检查。"
            },
            "host": {
              "type": "string",
              "description": "检查请求域名。"
            },
            "path": {
              "type": "string",
              "description": "检查路径,必须以 `/` 开头。"
            }
          }
        },
        "proxy_auth": {
          "type": "object",
          "description": "回源认证配置。",
          "additionalProperties": false,
          "properties": {
            "enable": {
              "type": "boolean",
              "description": "是否启用认证。"
            },
            "username": {
              "type": "string",
              "description": "认证用户名。"
            },
            "password": {
              "type": "string",
              "description": "认证密码。"
            }
          }
        },
        "proxy_cache": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "是否启用代理缓存。"
        },
        "gzip_enable": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "是否启用 Gzip。"
        },
        "gzip_types": {
          "type": "string",
          "description": "Gzip MIME 类型。"
        },
        "websocket_enable": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "是否启用 WebSocket 代理。"
        },
        "enable": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "网站启用状态。"
        },
        "state": {
          "type": "string",
          "description": "网站处理状态。"
        },
        "cname_mode": {
          "type": "string",
          "enum": [
            "package",
            "site"
          ],
          "description": "CNAME 使用方式;切换会触发相应同步任务。"
        },
        "cname_domain": {
          "type": "integer",
          "description": "管理员专用。CNAME 域名配置 ID。"
        },
        "cname_hostname": {
          "type": "string",
          "description": "管理员专用。网站 CNAME 主机名,必须唯一且合法。"
        },
        "region_id": {
          "type": "integer",
          "description": "管理员专用。区域 ID。"
        },
        "node_group_id": {
          "type": "integer",
          "description": "管理员专用。主线路组 ID;CNAME 按套餐时不能单独修改。"
        },
        "backup_node_group": {
          "type": "integer",
          "nullable": true,
          "description": "管理员专用。备用线路组 ID;不能与主线路组相同。"
        },
        "acl": {
          "type": "integer",
          "description": "ACL ID;传 null 或 0 表示不绑定。ACL 必须已启用且属于当前目标用户,否则要求管理员权限。",
          "example": 12,
          "minimum": 0,
          "nullable": true
        },
        "acme_proxy_to_orgin": {
          "type": "integer",
          "description": "是否将 `/.well-known/acme-challenge/` 请求回源:1 开启,0 关闭。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "backend_host": {
          "type": "string",
          "description": "回源 Host。允许 `$host`、`$host:$server_port`,或合法域名/IP及可选端口。",
          "example": "$host"
        },
        "black_ip": {
          "type": "string",
          "description": "网站黑名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。",
          "example": "198.51.100.0/24"
        },
        "block_proxy": {
          "type": "integer",
          "description": "是否拦截被识别为代理的客户端。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "block_region": {
          "type": "string",
          "description": "按两字母小写国家/地区代码拦截,多个值以逗号分隔;空字符串表示关闭。",
          "example": "us,jp",
          "pattern": "^$|^[a-z]{2}(,[a-z]{2})*$"
        },
        "block_time": {
          "type": "integer",
          "description": "自动黑名单持续时间,单位秒;非空时必须大于 600 且不超过 604800。",
          "example": 3600,
          "minimum": 601,
          "maximum": 604800
        },
        "cc_default_rule": {
          "type": "integer",
          "description": "默认 CC 规则 ID;规则必须存在且启用,使用其他用户的非内置规则需要管理员权限。",
          "example": 10002,
          "minimum": 1
        },
        "cc_switch": {
          "type": "object",
          "description": "CC 规则自动切换配置;空对象表示关闭。",
          "additionalProperties": false,
          "properties": {
            "rule": {
              "type": "integer",
              "description": "切换后的 CC 规则 ID。",
              "example": 10002,
              "minimum": 1
            },
            "switch": {
              "type": "integer",
              "description": "触发切换的请求阈值。",
              "example": 100,
              "minimum": 0
            },
            "enable": {
              "type": "integer",
              "description": "是否启用自动切换。",
              "example": 1,
              "enum": [
                0,
                1
              ]
            }
          },
          "required": [
            "rule",
            "switch"
          ],
          "example": {
            "rule": 10002,
            "switch": 100,
            "enable": 1
          }
        },
        "condition_backend": {
          "type": "array",
          "description": "按请求条件选择源站的规则列表。",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "matcher": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "description": "匹配条件。",
                  "additionalProperties": false,
                  "properties": {
                    "item": {
                      "type": "string",
                      "description": "匹配项。",
                      "example": "req_uri"
                    },
                    "op": {
                      "type": "string",
                      "description": "匹配操作符。",
                      "example": "contain",
                      "enum": [
                        ">",
                        "=",
                        "!=",
                        "contain",
                        "!contain",
                        "prefix",
                        "suffix",
                        "regex",
                        "!regex",
                        "exists",
                        "!exists",
                        "ip_range",
                        "!ip_range"
                      ]
                    },
                    "value": {
                      "type": "string",
                      "description": "匹配值;服务端会去除空行和首尾空白。",
                      "example": "/api/"
                    }
                  },
                  "required": [
                    "item",
                    "op",
                    "value"
                  ],
                  "example": {
                    "item": "req_uri",
                    "op": "contain",
                    "value": "/api/"
                  }
                },
                "description": "全部匹配条件。"
              },
              "backend": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "description": "条件命中时使用的源站。",
                  "additionalProperties": false,
                  "properties": {
                    "addr": {
                      "type": "string",
                      "description": "源站 IPv4、IPv6 或域名。",
                      "example": "198.51.100.10"
                    },
                    "weight": {
                      "type": "integer",
                      "description": "源站权重。",
                      "example": 1,
                      "minimum": 1,
                      "maximum": 10
                    },
                    "state": {
                      "type": "string",
                      "description": "源站状态。",
                      "example": "up",
                      "enum": [
                        "up",
                        "down",
                        "backup"
                      ]
                    }
                  },
                  "required": [
                    "addr"
                  ],
                  "example": {
                    "addr": "198.51.100.10",
                    "weight": 1,
                    "state": "up"
                  }
                },
                "description": "命中后使用的源站列表。"
              }
            },
            "required": [
              "matcher",
              "backend"
            ]
          },
          "example": [
            {
              "matcher": [
                {
                  "item": "req_uri",
                  "op": "contain",
                  "value": "/api/"
                }
              ],
              "backend": [
                {
                  "addr": "198.51.100.10",
                  "weight": 1,
                  "state": "up"
                }
              ]
            }
          ]
        },
        "cookie_domain": {
          "type": "string",
          "description": "Cookie Domain;允许空字符串,非空时必须是合法域名。",
          "example": "example.invalid"
        },
        "cors": {
          "type": "object",
          "description": "跨域响应配置。",
          "additionalProperties": false,
          "properties": {
            "enable": {
              "type": "integer",
              "description": "是否启用 CORS。",
              "example": 1,
              "enum": [
                0,
                1
              ]
            },
            "allow_origin": {
              "type": "string",
              "description": "Access-Control-Allow-Origin 值。",
              "example": "*"
            },
            "allow_methods": {
              "type": "string",
              "description": "允许的方法,空格分隔。",
              "example": "GET POST OPTIONS"
            },
            "allow_headers": {
              "type": "string",
              "description": "允许的请求头,空格分隔。",
              "example": "Content-Type Authorization"
            },
            "expose_headers": {
              "type": "string",
              "description": "允许浏览器读取的响应头。",
              "example": "Content-Length"
            },
            "allow_credentials": {
              "type": "integer",
              "description": "是否允许携带凭证。",
              "example": 1,
              "enum": [
                0,
                1
              ]
            },
            "max_age": {
              "type": "string",
              "description": "预检结果缓存秒数;服务端要求传数字字符串。",
              "example": "1728000",
              "pattern": "^\\d+$"
            }
          },
          "required": [
            "enable",
            "allow_origin",
            "allow_methods",
            "allow_headers",
            "expose_headers",
            "allow_credentials",
            "max_age"
          ],
          "example": {
            "enable": 1,
            "allow_origin": "*",
            "allow_methods": "GET POST OPTIONS",
            "allow_headers": "Content-Type",
            "expose_headers": "Content-Length",
            "allow_credentials": 0,
            "max_age": "1728000"
          }
        },
        "dns_api": {
          "type": "integer",
          "description": "DNS API 凭据 ID;必须属于目标用户。传 null 表示不绑定。",
          "example": 8,
          "minimum": 1,
          "nullable": true
        },
        "enable_ipv6": {
          "type": "integer",
          "description": "是否启用 IPv6 CNAME;仅按网站生成 CNAME 且系统存在 IPv6 节点时可用。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "extra_cc_rule": {
          "type": "array",
          "description": "网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。",
          "items": {
            "type": "object",
            "description": "一条自定义 CC 规则,包含 matcher 与 filter 配置。",
            "additionalProperties": true
          },
          "example": [
            {
              "matcher": {
                "req_uri": {
                  "operator": "contain",
                  "value": "/api/"
                }
              },
              "filter": {
                "type": "req_rate",
                "within_second": 10,
                "max_req": 60
              }
            }
          ]
        },
        "groups": {
          "type": "string",
          "description": "网站分组 ID,多个 ID 使用逗号分隔;空字符串表示不加入分组。",
          "example": "3,8",
          "pattern": "^$|^\\d+(,\\d+)*$"
        },
        "hotlink": {
          "type": "object",
          "description": "防盗链配置。",
          "additionalProperties": false,
          "properties": {
            "enable": {
              "type": "integer",
              "description": "是否启用防盗链。",
              "example": 1,
              "enum": [
                0,
                1
              ]
            },
            "domain": {
              "type": "string",
              "description": "允许的来源域名,使用空格分隔;空值仅允许本站域名。",
              "example": "www.example.invalid"
            },
            "allow_empty": {
              "type": "integer",
              "description": "是否允许空 Referer。",
              "example": 1,
              "enum": [
                0,
                1
              ]
            },
            "scope_type": {
              "type": "string",
              "description": "生效范围。",
              "example": "all",
              "enum": [
                "all",
                "suffix",
                "dir",
                "full_path"
              ]
            },
            "scope_content": {
              "type": "string",
              "description": "非 all 范围的匹配内容。",
              "example": "/static/"
            }
          },
          "required": [
            "enable",
            "domain",
            "allow_empty"
          ],
          "example": {
            "enable": 1,
            "domain": "www.example.invalid",
            "allow_empty": 0,
            "scope_type": "all",
            "scope_content": ""
          }
        },
        "is_default_server": {
          "type": "integer",
          "description": "管理员专用。是否作为线路范围内的默认站点;同一节点的监听端口不能与其它默认站点冲突。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "l2_config_id": {
          "type": "integer",
          "description": "管理员专用。L2 配置 ID;必须存在、与网站区域一致并已绑定 L2 节点。",
          "example": 9,
          "minimum": 1
        },
        "l2_state": {
          "type": "string",
          "description": "管理员专用。L2 模式。",
          "example": "inherit",
          "enum": [
            "off",
            "inherit",
            "custom"
          ]
        },
        "log_req_body": {
          "type": "integer",
          "description": "管理员专用。是否记录请求体。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "log_req_body_max_size": {
          "type": "integer",
          "description": "管理员专用。记录请求体的最大 KiB;不能超过 2048,也不能超过全局 client_body_buffer_size。",
          "example": 16,
          "minimum": 0,
          "maximum": 2048
        },
        "log_req_header": {
          "type": "integer",
          "description": "管理员专用。是否记录请求头。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "log_resp_header": {
          "type": "integer",
          "description": "管理员专用。是否记录响应头。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "page_403": {
          "type": "string",
          "description": "自定义 403 错误页 HTML;空字符串使用默认页面。",
          "example": "<h1>Forbidden</h1>"
        },
        "page_404": {
          "type": "string",
          "description": "自定义 404 错误页 HTML;空字符串使用默认页面。",
          "example": "<h1>Not Found</h1>"
        },
        "page_500": {
          "type": "string",
          "description": "自定义 500 错误页 HTML;空字符串使用默认页面。",
          "example": "<h1>Server Error</h1>"
        },
        "page_502": {
          "type": "string",
          "description": "自定义 502 错误页 HTML;空字符串使用默认页面。",
          "example": "<h1>Bad Gateway</h1>"
        },
        "page_504": {
          "type": "string",
          "description": "自定义 504 错误页 HTML;空字符串使用默认页面。",
          "example": "<h1>Gateway Timeout</h1>"
        },
        "post_size_limit": {
          "type": "string",
          "description": "POST 请求体大小限制。可使用纯数字或 b/k/m/g 单位,大小写均可;空字符串表示采用默认配置。",
          "example": "10m",
          "pattern": "^$|^\\d+(?:[bBkKmMgG])?$"
        },
        "proxy_http_version": {
          "type": "string",
          "description": "回源 HTTP 协议版本。",
          "example": "1.1",
          "enum": [
            "1.0",
            "1.1"
          ]
        },
        "proxy_ssl_protocols": {
          "type": "string",
          "description": "允许的回源 TLS/SSL 协议,多个值使用空格分隔。",
          "example": "TLSv1.2 TLSv1.3",
          "pattern": "^(?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3)(?: (?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3))*$"
        },
        "range": {
          "type": "integer",
          "description": "是否启用分段回源。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "recv_real_time": {
          "type": "integer",
          "description": "是否实时向客户端返回上游响应数据。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "req_header": {
          "type": "array",
          "description": "添加或覆盖的回源请求头。",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "description": "请求头名称,必须以英文字母开头。",
                "example": "X-Example"
              },
              "value": {
                "type": "string",
                "description": "请求头值,去除首尾空白后不能为空。",
                "example": "example-value"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "example": [
            {
              "name": "X-Origin",
              "value": "itecdn"
            }
          ]
        },
        "resp_header": {
          "type": "array",
          "description": "添加或覆盖的客户端响应头。",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "description": "请求头名称,必须以英文字母开头。",
                "example": "X-Example"
              },
              "value": {
                "type": "string",
                "description": "请求头值,去除首尾空白后不能为空。",
                "example": "example-value"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "example": [
            {
              "name": "X-Cache",
              "value": "itecdn"
            }
          ]
        },
        "send_real_time": {
          "type": "integer",
          "description": "是否实时向上游发送客户端请求数据。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "spider_allow": {
          "type": "string",
          "description": "搜索引擎爬虫访问策略;空字符串表示不单独设置。",
          "example": "allow",
          "enum": [
            "",
            "allow",
            "deny"
          ]
        },
        "spider_to_sip": {
          "type": "string",
          "description": "搜索引擎专用回源 IP;空字符串表示关闭。仅按网站生成 CNAME 且 DNS 服务支持对应线路时可用。",
          "example": "198.51.100.20"
        },
        "ups_keepalive": {
          "type": "integer",
          "description": "是否启用上游 Keepalive。",
          "example": 1,
          "enum": [
            0,
            1
          ]
        },
        "ups_keepalive_conn": {
          "type": "integer",
          "description": "每个 worker 保留的上游 Keepalive 连接数。",
          "example": 16,
          "minimum": 1,
          "maximum": 100
        },
        "ups_keepalive_timeout": {
          "type": "integer",
          "description": "上游 Keepalive 空闲超时秒数。",
          "example": 60,
          "minimum": 0
        },
        "url_rewrite": {
          "type": "array",
          "description": "URL 重定向规则。",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "host": {
                "type": "string",
                "description": "匹配 Host,不含 http:// 或 https://。",
                "example": "www.example.invalid"
              },
              "match": {
                "type": "string",
                "description": "URI 匹配表达式。",
                "example": "/(.*)"
              },
              "redirect": {
                "type": "string",
                "description": "重定向目标;可使用 `$1` 或受支持的 Nginx 变量。",
                "example": "https://example.invalid/$1"
              },
              "code": {
                "type": "string",
                "description": "重定向方式。",
                "example": "301",
                "enum": [
                  "301",
                  "302",
                  "307",
                  "internal"
                ]
              },
              "user_agent": {
                "type": "string",
                "description": "User-Agent 匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "referer": {
                "type": "string",
                "description": "Referer 匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "country_code": {
                "type": "string",
                "description": "国家代码匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "accept_language": {
                "type": "string",
                "description": "Accept-Language 匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "province": {
                "type": "string",
                "description": "省份匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "city": {
                "type": "string",
                "description": "城市匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "isp": {
                "type": "string",
                "description": "运营商匹配;省略时为 `.*`。",
                "example": ".*"
              },
              "asnumber": {
                "type": "string",
                "description": "ASN 匹配;省略时为 `.*`。",
                "example": ".*"
              }
            },
            "required": [
              "host",
              "match",
              "redirect",
              "code"
            ]
          },
          "example": [
            {
              "host": "www.example.invalid",
              "match": "/(.*)",
              "redirect": "https://example.invalid/$1",
              "code": "301"
            }
          ]
        },
        "white_ip": {
          "type": "string",
          "description": "网站白名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。",
          "example": "203.0.113.10"
        },
        "white_time": {
          "type": "integer",
          "description": "自动白名单持续时间,单位秒;非空时不超过 604800。",
          "example": 3600,
          "minimum": 0,
          "maximum": 604800
        }
      }
    },
    {
      "type": "array",
      "minItems": 1,
      "description": "批量更新对象数组;每个元素独立按相同规则校验和更新。",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "description": "必填。要更新的网站 ID,必须存在且当前用户有权限操作。"
          },
          "domain": {
            "type": "string",
            "description": "网站域名,多个域名以空白字符分隔;会转为小写且不得重复。修改后重新校验套餐配额、区域内域名和域名端口唯一性。"
          },
          "backend": {
            "type": "array",
            "description": "源站列表。每项地址必须为 IPv4、IPv6 或域名,地址不可重复,至少保留一个 `up` 状态源站。",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "addr",
                "weight",
                "state"
              ],
              "properties": {
                "addr": {
                  "type": "string",
                  "description": "源站地址。"
                },
                "weight": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10,
                  "description": "源站权重。"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "up",
                    "down",
                    "backup"
                  ],
                  "description": "源站状态。"
                }
              }
            }
          },
          "user_package": {
            "type": "integer",
            "description": "用户套餐 ID;必须属于网站归属用户且可用。变更套餐会重新同步相关线路与配置。"
          },
          "new_uid": {
            "type": "integer",
            "description": "管理员专用。将网站转移到指定用户;同时必须传入 `user_package`。"
          },
          "uid": {
            "type": "integer",
            "description": "管理员专用。指定本次套餐与资源校验所使用的用户 ID。"
          },
          "http_listen": {
            "type": "object",
            "description": "HTTP 监听配置;与 HTTPS 至少保留一个。",
            "additionalProperties": false,
            "properties": {
              "port": {
                "type": "string",
                "description": "空白分隔的监听端口;每个端口必须有效、未占用且在区域允许范围内。"
              }
            }
          },
          "https_listen": {
            "type": "object",
            "description": "HTTPS 监听配置。",
            "additionalProperties": false,
            "properties": {
              "port": {
                "type": "string",
                "description": "空白分隔的 HTTPS 监听端口。"
              },
              "cert": {
                "type": "integer",
                "description": "已启用证书 ID。"
              },
              "hsts": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用 HSTS。"
              },
              "http2": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用 HTTP/2。"
              },
              "http3": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用 HTTP/3。"
              },
              "ocsp_stapling": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用 OCSP Stapling。"
              },
              "force_ssl_enable": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否强制跳转 HTTPS。"
              },
              "force_ssl_port": {
                "type": "string",
                "description": "强制跳转目标端口,必须在 HTTPS 监听端口中。"
              },
              "ssl_protocols": {
                "type": "string",
                "description": "允许的 TLS 协议,使用空白字符分隔。"
              },
              "ssl_ciphers": {
                "type": "string",
                "description": "TLS 密码套件。"
              },
              "ssl_prefer_server_ciphers": {
                "type": "string",
                "enum": [
                  "on",
                  "off"
                ],
                "description": "是否优先使用服务端密码套件。"
              }
            }
          },
          "balance_way": {
            "type": "string",
            "enum": [
              "ip_hash",
              "rr"
            ],
            "description": "负载均衡方式。`ip_hash` 不支持备用源站。"
          },
          "backend_protocol": {
            "type": "string",
            "enum": [
              "follow",
              "http",
              "https"
            ],
            "description": "回源协议。"
          },
          "backend_http_port": {
            "type": "integer",
            "description": "HTTP 回源端口。"
          },
          "backend_https_port": {
            "type": "integer",
            "description": "HTTPS 回源端口。"
          },
          "backend_port_mapping": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否使用访问端口作为回源端口。"
          },
          "proxy_timeout": {
            "type": "integer",
            "maximum": 86400,
            "description": "回源读取超时,单位秒。"
          },
          "proxy_connect_timeout": {
            "type": "integer",
            "maximum": 75,
            "description": "回源连接超时,单位秒。"
          },
          "health_check": {
            "type": "object",
            "description": "健康检查配置。",
            "additionalProperties": false,
            "properties": {
              "enable": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用健康检查。"
              },
              "host": {
                "type": "string",
                "description": "检查请求域名。"
              },
              "path": {
                "type": "string",
                "description": "检查路径,必须以 `/` 开头。"
              }
            }
          },
          "proxy_auth": {
            "type": "object",
            "description": "回源认证配置。",
            "additionalProperties": false,
            "properties": {
              "enable": {
                "type": "boolean",
                "description": "是否启用认证。"
              },
              "username": {
                "type": "string",
                "description": "认证用户名。"
              },
              "password": {
                "type": "string",
                "description": "认证密码。"
              }
            }
          },
          "proxy_cache": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否启用代理缓存。"
          },
          "gzip_enable": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否启用 Gzip。"
          },
          "gzip_types": {
            "type": "string",
            "description": "Gzip MIME 类型。"
          },
          "websocket_enable": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否启用 WebSocket 代理。"
          },
          "enable": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "网站启用状态。"
          },
          "state": {
            "type": "string",
            "description": "网站处理状态。"
          },
          "cname_mode": {
            "type": "string",
            "enum": [
              "package",
              "site"
            ],
            "description": "CNAME 使用方式;切换会触发相应同步任务。"
          },
          "cname_domain": {
            "type": "integer",
            "description": "管理员专用。CNAME 域名配置 ID。"
          },
          "cname_hostname": {
            "type": "string",
            "description": "管理员专用。网站 CNAME 主机名,必须唯一且合法。"
          },
          "region_id": {
            "type": "integer",
            "description": "管理员专用。区域 ID。"
          },
          "node_group_id": {
            "type": "integer",
            "description": "管理员专用。主线路组 ID;CNAME 按套餐时不能单独修改。"
          },
          "backup_node_group": {
            "type": "integer",
            "nullable": true,
            "description": "管理员专用。备用线路组 ID;不能与主线路组相同。"
          },
          "acl": {
            "type": "integer",
            "description": "ACL ID;传 null 或 0 表示不绑定。ACL 必须已启用且属于当前目标用户,否则要求管理员权限。",
            "example": 12,
            "minimum": 0,
            "nullable": true
          },
          "acme_proxy_to_orgin": {
            "type": "integer",
            "description": "是否将 `/.well-known/acme-challenge/` 请求回源:1 开启,0 关闭。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "backend_host": {
            "type": "string",
            "description": "回源 Host。允许 `$host`、`$host:$server_port`,或合法域名/IP及可选端口。",
            "example": "$host"
          },
          "black_ip": {
            "type": "string",
            "description": "网站黑名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。",
            "example": "198.51.100.0/24"
          },
          "block_proxy": {
            "type": "integer",
            "description": "是否拦截被识别为代理的客户端。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "block_region": {
            "type": "string",
            "description": "按两字母小写国家/地区代码拦截,多个值以逗号分隔;空字符串表示关闭。",
            "example": "us,jp",
            "pattern": "^$|^[a-z]{2}(,[a-z]{2})*$"
          },
          "block_time": {
            "type": "integer",
            "description": "自动黑名单持续时间,单位秒;非空时必须大于 600 且不超过 604800。",
            "example": 3600,
            "minimum": 601,
            "maximum": 604800
          },
          "cc_default_rule": {
            "type": "integer",
            "description": "默认 CC 规则 ID;规则必须存在且启用,使用其他用户的非内置规则需要管理员权限。",
            "example": 10002,
            "minimum": 1
          },
          "cc_switch": {
            "type": "object",
            "description": "CC 规则自动切换配置;空对象表示关闭。",
            "additionalProperties": false,
            "properties": {
              "rule": {
                "type": "integer",
                "description": "切换后的 CC 规则 ID。",
                "example": 10002,
                "minimum": 1
              },
              "switch": {
                "type": "integer",
                "description": "触发切换的请求阈值。",
                "example": 100,
                "minimum": 0
              },
              "enable": {
                "type": "integer",
                "description": "是否启用自动切换。",
                "example": 1,
                "enum": [
                  0,
                  1
                ]
              }
            },
            "required": [
              "rule",
              "switch"
            ],
            "example": {
              "rule": 10002,
              "switch": 100,
              "enable": 1
            }
          },
          "condition_backend": {
            "type": "array",
            "description": "按请求条件选择源站的规则列表。",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "matcher": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "description": "匹配条件。",
                    "additionalProperties": false,
                    "properties": {
                      "item": {
                        "type": "string",
                        "description": "匹配项。",
                        "example": "req_uri"
                      },
                      "op": {
                        "type": "string",
                        "description": "匹配操作符。",
                        "example": "contain",
                        "enum": [
                          ">",
                          "=",
                          "!=",
                          "contain",
                          "!contain",
                          "prefix",
                          "suffix",
                          "regex",
                          "!regex",
                          "exists",
                          "!exists",
                          "ip_range",
                          "!ip_range"
                        ]
                      },
                      "value": {
                        "type": "string",
                        "description": "匹配值;服务端会去除空行和首尾空白。",
                        "example": "/api/"
                      }
                    },
                    "required": [
                      "item",
                      "op",
                      "value"
                    ],
                    "example": {
                      "item": "req_uri",
                      "op": "contain",
                      "value": "/api/"
                    }
                  },
                  "description": "全部匹配条件。"
                },
                "backend": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "description": "条件命中时使用的源站。",
                    "additionalProperties": false,
                    "properties": {
                      "addr": {
                        "type": "string",
                        "description": "源站 IPv4、IPv6 或域名。",
                        "example": "198.51.100.10"
                      },
                      "weight": {
                        "type": "integer",
                        "description": "源站权重。",
                        "example": 1,
                        "minimum": 1,
                        "maximum": 10
                      },
                      "state": {
                        "type": "string",
                        "description": "源站状态。",
                        "example": "up",
                        "enum": [
                          "up",
                          "down",
                          "backup"
                        ]
                      }
                    },
                    "required": [
                      "addr"
                    ],
                    "example": {
                      "addr": "198.51.100.10",
                      "weight": 1,
                      "state": "up"
                    }
                  },
                  "description": "命中后使用的源站列表。"
                }
              },
              "required": [
                "matcher",
                "backend"
              ]
            },
            "example": [
              {
                "matcher": [
                  {
                    "item": "req_uri",
                    "op": "contain",
                    "value": "/api/"
                  }
                ],
                "backend": [
                  {
                    "addr": "198.51.100.10",
                    "weight": 1,
                    "state": "up"
                  }
                ]
              }
            ]
          },
          "cookie_domain": {
            "type": "string",
            "description": "Cookie Domain;允许空字符串,非空时必须是合法域名。",
            "example": "example.invalid"
          },
          "cors": {
            "type": "object",
            "description": "跨域响应配置。",
            "additionalProperties": false,
            "properties": {
              "enable": {
                "type": "integer",
                "description": "是否启用 CORS。",
                "example": 1,
                "enum": [
                  0,
                  1
                ]
              },
              "allow_origin": {
                "type": "string",
                "description": "Access-Control-Allow-Origin 值。",
                "example": "*"
              },
              "allow_methods": {
                "type": "string",
                "description": "允许的方法,空格分隔。",
                "example": "GET POST OPTIONS"
              },
              "allow_headers": {
                "type": "string",
                "description": "允许的请求头,空格分隔。",
                "example": "Content-Type Authorization"
              },
              "expose_headers": {
                "type": "string",
                "description": "允许浏览器读取的响应头。",
                "example": "Content-Length"
              },
              "allow_credentials": {
                "type": "integer",
                "description": "是否允许携带凭证。",
                "example": 1,
                "enum": [
                  0,
                  1
                ]
              },
              "max_age": {
                "type": "string",
                "description": "预检结果缓存秒数;服务端要求传数字字符串。",
                "example": "1728000",
                "pattern": "^\\d+$"
              }
            },
            "required": [
              "enable",
              "allow_origin",
              "allow_methods",
              "allow_headers",
              "expose_headers",
              "allow_credentials",
              "max_age"
            ],
            "example": {
              "enable": 1,
              "allow_origin": "*",
              "allow_methods": "GET POST OPTIONS",
              "allow_headers": "Content-Type",
              "expose_headers": "Content-Length",
              "allow_credentials": 0,
              "max_age": "1728000"
            }
          },
          "dns_api": {
            "type": "integer",
            "description": "DNS API 凭据 ID;必须属于目标用户。传 null 表示不绑定。",
            "example": 8,
            "minimum": 1,
            "nullable": true
          },
          "enable_ipv6": {
            "type": "integer",
            "description": "是否启用 IPv6 CNAME;仅按网站生成 CNAME 且系统存在 IPv6 节点时可用。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "extra_cc_rule": {
            "type": "array",
            "description": "网站自定义 CC 规则列表。规则结构随 matcher/filter 类型变化,服务端会逐项校验。",
            "items": {
              "type": "object",
              "description": "一条自定义 CC 规则,包含 matcher 与 filter 配置。",
              "additionalProperties": true
            },
            "example": [
              {
                "matcher": {
                  "req_uri": {
                    "operator": "contain",
                    "value": "/api/"
                  }
                },
                "filter": {
                  "type": "req_rate",
                  "within_second": 10,
                  "max_req": 60
                }
              }
            ]
          },
          "groups": {
            "type": "string",
            "description": "网站分组 ID,多个 ID 使用逗号分隔;空字符串表示不加入分组。",
            "example": "3,8",
            "pattern": "^$|^\\d+(,\\d+)*$"
          },
          "hotlink": {
            "type": "object",
            "description": "防盗链配置。",
            "additionalProperties": false,
            "properties": {
              "enable": {
                "type": "integer",
                "description": "是否启用防盗链。",
                "example": 1,
                "enum": [
                  0,
                  1
                ]
              },
              "domain": {
                "type": "string",
                "description": "允许的来源域名,使用空格分隔;空值仅允许本站域名。",
                "example": "www.example.invalid"
              },
              "allow_empty": {
                "type": "integer",
                "description": "是否允许空 Referer。",
                "example": 1,
                "enum": [
                  0,
                  1
                ]
              },
              "scope_type": {
                "type": "string",
                "description": "生效范围。",
                "example": "all",
                "enum": [
                  "all",
                  "suffix",
                  "dir",
                  "full_path"
                ]
              },
              "scope_content": {
                "type": "string",
                "description": "非 all 范围的匹配内容。",
                "example": "/static/"
              }
            },
            "required": [
              "enable",
              "domain",
              "allow_empty"
            ],
            "example": {
              "enable": 1,
              "domain": "www.example.invalid",
              "allow_empty": 0,
              "scope_type": "all",
              "scope_content": ""
            }
          },
          "is_default_server": {
            "type": "integer",
            "description": "管理员专用。是否作为线路范围内的默认站点;同一节点的监听端口不能与其它默认站点冲突。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "l2_config_id": {
            "type": "integer",
            "description": "管理员专用。L2 配置 ID;必须存在、与网站区域一致并已绑定 L2 节点。",
            "example": 9,
            "minimum": 1
          },
          "l2_state": {
            "type": "string",
            "description": "管理员专用。L2 模式。",
            "example": "inherit",
            "enum": [
              "off",
              "inherit",
              "custom"
            ]
          },
          "log_req_body": {
            "type": "integer",
            "description": "管理员专用。是否记录请求体。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "log_req_body_max_size": {
            "type": "integer",
            "description": "管理员专用。记录请求体的最大 KiB;不能超过 2048,也不能超过全局 client_body_buffer_size。",
            "example": 16,
            "minimum": 0,
            "maximum": 2048
          },
          "log_req_header": {
            "type": "integer",
            "description": "管理员专用。是否记录请求头。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "log_resp_header": {
            "type": "integer",
            "description": "管理员专用。是否记录响应头。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "page_403": {
            "type": "string",
            "description": "自定义 403 错误页 HTML;空字符串使用默认页面。",
            "example": "<h1>Forbidden</h1>"
          },
          "page_404": {
            "type": "string",
            "description": "自定义 404 错误页 HTML;空字符串使用默认页面。",
            "example": "<h1>Not Found</h1>"
          },
          "page_500": {
            "type": "string",
            "description": "自定义 500 错误页 HTML;空字符串使用默认页面。",
            "example": "<h1>Server Error</h1>"
          },
          "page_502": {
            "type": "string",
            "description": "自定义 502 错误页 HTML;空字符串使用默认页面。",
            "example": "<h1>Bad Gateway</h1>"
          },
          "page_504": {
            "type": "string",
            "description": "自定义 504 错误页 HTML;空字符串使用默认页面。",
            "example": "<h1>Gateway Timeout</h1>"
          },
          "post_size_limit": {
            "type": "string",
            "description": "POST 请求体大小限制。可使用纯数字或 b/k/m/g 单位,大小写均可;空字符串表示采用默认配置。",
            "example": "10m",
            "pattern": "^$|^\\d+(?:[bBkKmMgG])?$"
          },
          "proxy_http_version": {
            "type": "string",
            "description": "回源 HTTP 协议版本。",
            "example": "1.1",
            "enum": [
              "1.0",
              "1.1"
            ]
          },
          "proxy_ssl_protocols": {
            "type": "string",
            "description": "允许的回源 TLS/SSL 协议,多个值使用空格分隔。",
            "example": "TLSv1.2 TLSv1.3",
            "pattern": "^(?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3)(?: (?:SSLv2|SSLv3|TLSv1|TLSv1\\.1|TLSv1\\.2|TLSv1\\.3))*$"
          },
          "range": {
            "type": "integer",
            "description": "是否启用分段回源。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "recv_real_time": {
            "type": "integer",
            "description": "是否实时向客户端返回上游响应数据。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "req_header": {
            "type": "array",
            "description": "添加或覆盖的回源请求头。",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "description": "请求头名称,必须以英文字母开头。",
                  "example": "X-Example"
                },
                "value": {
                  "type": "string",
                  "description": "请求头值,去除首尾空白后不能为空。",
                  "example": "example-value"
                }
              },
              "required": [
                "name",
                "value"
              ]
            },
            "example": [
              {
                "name": "X-Origin",
                "value": "itecdn"
              }
            ]
          },
          "resp_header": {
            "type": "array",
            "description": "添加或覆盖的客户端响应头。",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "description": "请求头名称,必须以英文字母开头。",
                  "example": "X-Example"
                },
                "value": {
                  "type": "string",
                  "description": "请求头值,去除首尾空白后不能为空。",
                  "example": "example-value"
                }
              },
              "required": [
                "name",
                "value"
              ]
            },
            "example": [
              {
                "name": "X-Cache",
                "value": "itecdn"
              }
            ]
          },
          "send_real_time": {
            "type": "integer",
            "description": "是否实时向上游发送客户端请求数据。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "spider_allow": {
            "type": "string",
            "description": "搜索引擎爬虫访问策略;空字符串表示不单独设置。",
            "example": "allow",
            "enum": [
              "",
              "allow",
              "deny"
            ]
          },
          "spider_to_sip": {
            "type": "string",
            "description": "搜索引擎专用回源 IP;空字符串表示关闭。仅按网站生成 CNAME 且 DNS 服务支持对应线路时可用。",
            "example": "198.51.100.20"
          },
          "ups_keepalive": {
            "type": "integer",
            "description": "是否启用上游 Keepalive。",
            "example": 1,
            "enum": [
              0,
              1
            ]
          },
          "ups_keepalive_conn": {
            "type": "integer",
            "description": "每个 worker 保留的上游 Keepalive 连接数。",
            "example": 16,
            "minimum": 1,
            "maximum": 100
          },
          "ups_keepalive_timeout": {
            "type": "integer",
            "description": "上游 Keepalive 空闲超时秒数。",
            "example": 60,
            "minimum": 0
          },
          "url_rewrite": {
            "type": "array",
            "description": "URL 重定向规则。",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "host": {
                  "type": "string",
                  "description": "匹配 Host,不含 http:// 或 https://。",
                  "example": "www.example.invalid"
                },
                "match": {
                  "type": "string",
                  "description": "URI 匹配表达式。",
                  "example": "/(.*)"
                },
                "redirect": {
                  "type": "string",
                  "description": "重定向目标;可使用 `$1` 或受支持的 Nginx 变量。",
                  "example": "https://example.invalid/$1"
                },
                "code": {
                  "type": "string",
                  "description": "重定向方式。",
                  "example": "301",
                  "enum": [
                    "301",
                    "302",
                    "307",
                    "internal"
                  ]
                },
                "user_agent": {
                  "type": "string",
                  "description": "User-Agent 匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "referer": {
                  "type": "string",
                  "description": "Referer 匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "country_code": {
                  "type": "string",
                  "description": "国家代码匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "accept_language": {
                  "type": "string",
                  "description": "Accept-Language 匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "province": {
                  "type": "string",
                  "description": "省份匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "city": {
                  "type": "string",
                  "description": "城市匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "isp": {
                  "type": "string",
                  "description": "运营商匹配;省略时为 `.*`。",
                  "example": ".*"
                },
                "asnumber": {
                  "type": "string",
                  "description": "ASN 匹配;省略时为 `.*`。",
                  "example": ".*"
                }
              },
              "required": [
                "host",
                "match",
                "redirect",
                "code"
              ]
            },
            "example": [
              {
                "host": "www.example.invalid",
                "match": "/(.*)",
                "redirect": "https://example.invalid/$1",
                "code": "301"
              }
            ]
          },
          "white_ip": {
            "type": "string",
            "description": "网站白名单,每行可写 IP 或 CIDR;支持空行、注释和行尾注释,数量受区域配置限制。",
            "example": "203.0.113.10"
          },
          "white_time": {
            "type": "integer",
            "description": "自动白名单持续时间,单位秒;非空时不超过 604800。",
            "example": 3600,
            "minimum": 0,
            "maximum": 604800
          }
        }
      }
    }
  ],
  "example": {
    "id": 101,
    "backend": [
      {
        "addr": "198.51.100.20",
        "weight": 1,
        "state": "up"
      }
    ],
    "proxy_timeout": 60
  }
}

请求体示例

{
  "id": 101,
  "backend": [
    {
      "addr": "198.51.100.20",
      "weight": 1,
      "state": "up"
    }
  ],
  "proxy_timeout": 60
}

响应

HTTP 200

请求已被处理。成功时 code 为 0、msg 为“更新网站成功”、data 为 null;业务校验失败同样返回 HTTP 200,并在 code 与 msg 中说明原因。

application/json

object

字段类型必填说明与约束
codeinteger必填

业务状态码;成功为 0,失败时为对应的 site-* 错误码。

约束 / 默认值 / 示例
{
  "example": 0
}
msgstring必填

处理结果说明。

约束 / 默认值 / 示例
{
  "example": "更新网站成功"
}
datastring必填

成功时为 null;失败时为空字符串。

约束 / 默认值 / 示例
{
  "nullable": true,
  "example": null
}
完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "msg",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "description": "业务状态码;成功为 0,失败时为对应的 site-* 错误码。",
      "example": 0
    },
    "msg": {
      "type": "string",
      "description": "处理结果说明。",
      "example": "更新网站成功"
    },
    "data": {
      "type": "string",
      "nullable": true,
      "description": "成功时为 null;失败时为空字符串。",
      "example": null
    }
  }
}

示例

{
  "code": 0,
  "msg": "更新网站成功",
  "data": null
}

更新成功

{
  "code": 0,
  "msg": "更新网站成功",
  "data": null
}

网站不存在

{
  "code": "site-10",
  "msg": "网站不存在",
  "data": ""
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request PUT \
  "https://master.example.invalid/v1/sites" \
  --header "access-token: YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"id": 101, "backend": [{"addr": "198.51.100.20", "weight": 1, "state": "up"}], "proxy_timeout": 60}'

查看完整接口 JSON