ALIYUN::ESA::OriginRule类型用于添加站点回源规则配置。
语法
{
"Type": "ALIYUN::ESA::OriginRule",
"Properties": {
"SiteId": Integer,
"DnsRecord": String,
"Follow302MaxTries": Integer,
"Follow302RetainArgs": String,
"Follow302RetainHeader": String,
"Follow302TargetHost": String,
"Follow302Enable": String,
"OriginHttpsPort": Integer,
"OriginScheme": String,
"OriginReadTimeout": Integer,
"OriginHost": String,
"OriginHttpPort": Integer,
"OriginMtls": String,
"OriginSni": String,
"OriginVerify": String,
"RuleEnable": String,
"Range": String,
"RangeChunkSize": String,
"Rule": String,
"RuleName": String,
"Sequence": Integer,
"SiteVersion": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
SiteId | Integer | 是 | 否 | 站点 ID。 | 无 |
DnsRecord | String | 否 | 是 | 改写回源请求的 DNS 解析记录。 | 无 |
Follow302MaxTries | Integer | 否 | 是 | 302 跟随次数上限。 | 取值范围:1~5。 |
Follow302RetainArgs | String | 否 | 是 | 保留原始请求参数开关。 | 取值范围:
|
Follow302RetainHeader | String | 否 | 是 | 保留原始请求头开关。 | 取值范围:
|
Follow302TargetHost | String | 否 | 是 | 修改 302 后的回源 host。 | 无 |
Follow302Enable | String | 否 | 是 | 回源 302 跟随开关。 | 取值范围:
|
OriginHttpsPort | Integer | 否 | 是 | 使用 HTTPS 协议回源时访问的源站端口。 | 无 |
OriginScheme | String | 否 | 是 | 回源请求使用的协议。 | 取值范围:
|
OriginReadTimeout | Integer | 否 | 是 | 源站读超时时间(秒)。 | 无 |
OriginHost | String | 否 | 是 | 回源请求中携带的 HOST。 | 无 |
OriginHttpPort | Integer | 否 | 是 | 使用 HTTP 协议回源时访问的源站端口。 | 无 |
OriginMtls | String | 否 | 是 | mtls 开关。 | 取值范围:
|
OriginSni | String | 否 | 是 | 回源请求中携带的 SNI。 | 无 |
OriginVerify | String | 否 | 是 | 源站证书校验开关。 | 取值范围:
|
RuleEnable | String | 否 | 是 | 规则开关。 | 添加全局配置的时候不需要设置该参数。取值范围:
|
Range | String | 否 | 是 | 使用 range 分片方式回源下载文件。 | 取值范围:
|
RangeChunkSize | String | 否 | 是 | range 分片大小。 | 取值范围:
|
Rule | String | 否 | 是 | 规则内容。 | 使用条件表达式来匹配用户请求。添加全局配置的时候不需要设置该参数。存在两种使用场景:
|
RuleName | String | 否 | 是 | 规则名称。 | 添加全局配置的时候不需要设置该参数。 |
Sequence | Integer | 否 | 是 | 规则执行顺序。 | 数值越小越优先执行。 |
SiteVersion | Integer | 否 | 否 | 站点配置的版本号。 | 无 |
返回值
Fn::GetAtt
Follow302MaxTries:302 跟随次数上限,
RuleEnable:规则开关。
OriginHttpsPort:使用 HTTPS 协议回源时访问的源站端口。
Follow302RetainArgs:保留原始请求参数开关。
Follow302RetainHeader:保留原始请求头开关。
OriginScheme:回源请求使用的协议。
Sequence:规则执行顺序。
Range:使用 range 分片方式回源下载文件。
RangeChunkSize:range 分片大小。
OriginReadTimeout:源站读超时时间(秒)。
OriginHost:回源请求中携带的 HOST。
OriginHttpPort:使用 HTTP 协议回源时访问的源站端口。
OriginMtls:mtls 开关。
Follow302TargetHost:修改 302 后的回源 host。
OriginSni:回源请求中携带的 SNI。
Rule:规则内容。
ConfigId:配置 ID。
Follow302Enable:回源 302 跟随开关。
DnsRecord:改写回源请求的 DNS 解析记录。
ConfigType:配置类型。
SiteVersion:站点配置的版本号。
RuleName:规则名称。
OriginVerify:源站证书校验开关。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SiteId:
Type: Number
Description:
en: The site ID.
Required: true
RuleEnable:
Type: String
Description:
en: |-
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- `on`: open.
- `off`: close.
AllowedValues:
- 'on'
- 'off'
Required: false
Rule:
Type: String
Description:
en: |-
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true
- Match specified request: Set the value to a custom expression, for example: (http.host eq \"video.example.com\").
Required: false
RuleName:
Type: String
Description:
en: Rule name. When adding global configuration, this parameter does not need to be set.
Required: false
Resources:
ExtensionResource:
Type: ALIYUN::ESA::OriginRule
Properties:
SiteId:
Ref: SiteId
RuleEnable:
Ref: RuleEnable
Rule:
Ref: Rule
RuleName:
Ref: RuleName
Outputs:
Follow302MaxTries:
Description: 302 follows the upper limit of the number of times, with a value range of [1-5].
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302MaxTries
RuleEnable:
Description: Rule switch. When adding global configuration, this parameter does not need to be set.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleEnable
OriginHttpsPort:
Description: The port of the origin station accessed when the HTTPS protocol is used to return to the origin.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHttpsPort
Follow302RetainArgs:
Description: Retain the original request parameter switch.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302RetainArgs
Follow302RetainHeader:
Description: Retain the original request header switch.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302RetainHeader
OriginScheme:
Description: The protocol used by the back-to-origin request.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginScheme
Sequence:
Description: Order of rule execution. The smaller the value, the higher the priority for execution.
Value:
Fn::GetAtt:
- ExtensionResource
- Sequence
Range:
Description: Use the range sharding method to download the file from the source.
Value:
Fn::GetAtt:
- ExtensionResource
- Range
RangeChunkSize:
Description: range shard size.
Value:
Fn::GetAtt:
- ExtensionResource
- RangeChunkSize
OriginReadTimeout:
Description: Read timeout interval of the source station (s).
Value:
Fn::GetAtt:
- ExtensionResource
- OriginReadTimeout
OriginHost:
Description: The HOST carried in the back-to-origin request.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHost
OriginHttpPort:
Description: The port of the origin station accessed when the HTTP protocol is used to return to the origin.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHttpPort
OriginMtls:
Description: The mtls switch.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginMtls
Follow302TargetHost:
Description: Modify the source host after 302.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302TargetHost
OriginSni:
Description: SNI carried in the back-to-origin request.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginSni
Rule:
Description: Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.
Value:
Fn::GetAtt:
- ExtensionResource
- Rule
ConfigId:
Description: Back-to-source rule configuration ID.
Value:
Fn::GetAtt:
- ExtensionResource
- ConfigId
Follow302Enable:
Description: Return Source 302 follow switch.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302Enable
DnsRecord:
Description: Overwrite the DNS resolution record of the origin request.
Value:
Fn::GetAtt:
- ExtensionResource
- DnsRecord
ConfigType:
Description: The configuration type. You can use this parameter to check the global configuration or rule configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- ConfigType
SiteVersion:
Description: The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
Value:
Fn::GetAtt:
- ExtensionResource
- SiteVersion
RuleName:
Description: Rule name. When adding global configuration, this parameter does not need to be set.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleName
OriginVerify:
Description: Source station certificate verification switch.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginVerify
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SiteId": {
"Type": "Number",
"Description": {
"en": "The site ID."
},
"Required": true
},
"RuleEnable": {
"Type": "String",
"Description": {
"en": "Rule switch. When adding global configuration, this parameter does not need to be set. Value range:\n- `on`: open.\n- `off`: close."
},
"AllowedValues": [
"on",
"off"
],
"Required": false
},
"Rule": {
"Type": "String",
"Description": {
"en": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:\n- Match all incoming requests: value set to true\n- Match specified request: Set the value to a custom expression, for example: (http.host eq \\\"video.example.com\\\")."
},
"Required": false
},
"RuleName": {
"Type": "String",
"Description": {
"en": "Rule name. When adding global configuration, this parameter does not need to be set."
},
"Required": false
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::ESA::OriginRule",
"Properties": {
"SiteId": {
"Ref": "SiteId"
},
"RuleEnable": {
"Ref": "RuleEnable"
},
"Rule": {
"Ref": "Rule"
},
"RuleName": {
"Ref": "RuleName"
}
}
}
},
"Outputs": {
"Follow302MaxTries": {
"Description": "302 follows the upper limit of the number of times, with a value range of [1-5].",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302MaxTries"
]
}
},
"RuleEnable": {
"Description": "Rule switch. When adding global configuration, this parameter does not need to be set.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleEnable"
]
}
},
"OriginHttpsPort": {
"Description": "The port of the origin station accessed when the HTTPS protocol is used to return to the origin.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHttpsPort"
]
}
},
"Follow302RetainArgs": {
"Description": "Retain the original request parameter switch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302RetainArgs"
]
}
},
"Follow302RetainHeader": {
"Description": "Retain the original request header switch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302RetainHeader"
]
}
},
"OriginScheme": {
"Description": "The protocol used by the back-to-origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginScheme"
]
}
},
"Sequence": {
"Description": "Order of rule execution. The smaller the value, the higher the priority for execution.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Sequence"
]
}
},
"Range": {
"Description": "Use the range sharding method to download the file from the source.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Range"
]
}
},
"RangeChunkSize": {
"Description": "range shard size.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RangeChunkSize"
]
}
},
"OriginReadTimeout": {
"Description": "Read timeout interval of the source station (s).",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginReadTimeout"
]
}
},
"OriginHost": {
"Description": "The HOST carried in the back-to-origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHost"
]
}
},
"OriginHttpPort": {
"Description": "The port of the origin station accessed when the HTTP protocol is used to return to the origin.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHttpPort"
]
}
},
"OriginMtls": {
"Description": "The mtls switch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginMtls"
]
}
},
"Follow302TargetHost": {
"Description": "Modify the source host after 302.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302TargetHost"
]
}
},
"OriginSni": {
"Description": "SNI carried in the back-to-origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginSni"
]
}
},
"Rule": {
"Description": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Rule"
]
}
},
"ConfigId": {
"Description": "Back-to-source rule configuration ID.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConfigId"
]
}
},
"Follow302Enable": {
"Description": "Return Source 302 follow switch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302Enable"
]
}
},
"DnsRecord": {
"Description": "Overwrite the DNS resolution record of the origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"DnsRecord"
]
}
},
"ConfigType": {
"Description": "The configuration type. You can use this parameter to check the global configuration or rule configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConfigType"
]
}
},
"SiteVersion": {
"Description": "The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"SiteVersion"
]
}
},
"RuleName": {
"Description": "Rule name. When adding global configuration, this parameter does not need to be set.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleName"
]
}
},
"OriginVerify": {
"Description": "Source station certificate verification switch.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginVerify"
]
}
}
}
}