Adiciona regras de origem a um site.
Sintaxe
{
"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
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatório |
Atualização permitida |
Descrição |
Restrições |
|
SiteId |
Integer |
Sim |
Não |
ID do site. |
Nenhuma |
|
DnsRecord |
String |
Não |
Sim |
Registro DNS usado para substituir a solicitação de origem. |
Nenhuma |
|
Follow302MaxTries |
Integer |
Não |
Sim |
Número máximo de redirecionamentos 302 a seguir. |
Valores válidos: 1 a 5. |
|
Follow302RetainArgs |
String |
Não |
Sim |
Indica se os parâmetros da solicitação original são mantidos. |
Valores válidos:
|
|
Follow302RetainHeader |
String |
Não |
Sim |
Indica se os cabeçalhos da solicitação original são mantidos. |
Valores válidos:
|
|
Follow302TargetHost |
String |
Não |
Sim |
Host de origem usado após um redirecionamento 302. |
Nenhuma |
|
Follow302Enable |
String |
Não |
Sim |
Indica se as solicitações de regras de origem seguem redirecionamentos 302. |
Valores válidos:
|
|
OriginHttpsPort |
Integer |
Não |
Sim |
Porta do servidor de origem acessada nas solicitações de regras de origem via HTTPS. |
Nenhuma |
|
OriginScheme |
String |
Não |
Sim |
Protocolo das solicitações de regras de origem. |
Valores válidos:
|
|
OriginReadTimeout |
Integer |
Não |
Sim |
Tempo limite de leitura da origem, em segundos. |
Nenhuma |
|
OriginHost |
String |
Não |
Sim |
Cabeçalho HOST incluído na solicitação de retorno à origem. |
Nenhuma |
|
OriginHttpPort |
Integer |
Não |
Sim |
Porta do servidor de origem acessada nas solicitações de retorno à origem via HTTP. |
Nenhuma |
|
OriginMtls |
String |
Não |
Sim |
Indica se o mTLS (mutual Transport Layer Security) está ativado. |
Valores válidos:
|
|
OriginSni |
String |
Não |
Sim |
SNI (Server Name Indication) incluído na solicitação de retorno à origem. |
Nenhuma |
|
OriginVerify |
String |
Não |
Sim |
Indica se o certificado do servidor de origem é verificado. |
Valores válidos:
|
|
RuleEnable |
String |
Não |
Sim |
Indica se a regra está ativada. |
Este parâmetro não é obrigatório para configurações globais. Valores válidos:
|
|
Range |
String |
Não |
Sim |
Indica se solicitações de intervalo são usadas para baixar arquivos da origem. |
Valores válidos:
|
|
RangeChunkSize |
String |
Não |
Sim |
Tamanho de cada shard de intervalo. |
Valores válidos:
|
|
Rule |
String |
Não |
Sim |
Conteúdo da regra. |
Use uma expressão condicional para corresponder às solicitações do usuário. Este parâmetro não é obrigatório para configurações globais. Existem dois cenários:
|
|
RuleName |
String |
Não |
Sim |
Nome da regra. |
Este parâmetro não é obrigatório para configurações globais. |
|
Sequence |
Integer |
Não |
Sim |
Prioridade de execução da regra. |
Um valor menor indica maior prioridade. |
|
SiteVersion |
Integer |
Não |
Não |
Número da versão da configuração do site. |
Nenhuma |
Valores de retorno
Fn::GetAtt
Follow302MaxTries: Número máximo de redirecionamentos 302 a seguir.
RuleEnable: Indica se a regra está ativada.
OriginHttpsPort: Porta do servidor de origem para solicitações de regras de origem via HTTPS.
Follow302RetainArgs: Indica se os parâmetros da solicitação original são mantidos.
Follow302RetainHeader: Indica se os cabeçalhos da solicitação original são mantidos.
OriginScheme: Protocolo das solicitações de regras de origem.
Sequence: Prioridade de execução da regra.
Range: Indica se o particionamento por intervalos é usado para baixar arquivos da origem.
RangeChunkSize: Tamanho de cada shard de intervalo.
OriginReadTimeout: Tempo limite de leitura da origem, em segundos.
OriginHost: Cabeçalho HOST na solicitação de regras de origem.
OriginHttpPort: Porta do servidor de origem para solicitações de regras de origem via HTTP.
OriginMtls: Indica se o mTLS (mutual TLS) está ativado.
Follow302TargetHost: Host de origem usado após um redirecionamento 302.
OriginSni: SNI (Server Name Indication) na solicitação de regras de origem.
Rule: Conteúdo da regra.
ConfigId: ID da configuração.
Follow302Enable: Indica se as solicitações de regras de origem seguem redirecionamentos 302.
DnsRecord: Registro DNS usado para substituir a solicitação de origem.
ConfigType: Tipo de configuração.
SiteVersion: Número da versão da configuração do site.
RuleName: Nome da regra.
OriginVerify: Indica se o certificado do servidor de origem é verificado.
Exemplos
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SiteId:
Type: Number
Description:
en: The site ID.
Required: true
RuleEnable:
Type: String
Description:
en: |-
Specifies whether to enable the rule. This parameter is not required for global configurations. Valid values:
- `on`: Enables the rule.
- `off`: Disables the rule.
AllowedValues:
- 'on'
- 'off'
Required: false
Rule:
Type: String
Description:
en: |-
The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations. Scenarios:
- To match all incoming requests, set the value to true.
- To match a specific request, set the value to a custom expression, such as (http.host eq "video.example.com").
Required: false
RuleName:
Type: String
Description:
en: The name of the rule. This parameter is not required for global configurations.
Required: false
Resources:
ExtensionResource:
Type: ALIYUN::ESA::OriginRule
Properties:
SiteId:
Ref: SiteId
RuleEnable:
Ref: RuleEnable
Rule:
Ref: Rule
RuleName:
Ref: RuleName
Outputs:
Follow302MaxTries:
Description: The maximum number of 302 redirects to follow. Valid values: 1 to 5.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302MaxTries
RuleEnable:
Description: Specifies whether the rule is enabled. This parameter is not required for global configurations.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleEnable
OriginHttpsPort:
Description: The origin server port for back-to-origin requests over HTTPS.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHttpsPort
Follow302RetainArgs:
Description: Specifies whether to retain the original request parameters.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302RetainArgs
Follow302RetainHeader:
Description: Specifies whether to retain the original request headers.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302RetainHeader
OriginScheme:
Description: The protocol for origin rules requests.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginScheme
Sequence:
Description: The execution priority of the rule. A smaller value indicates a higher priority.
Value:
Fn::GetAtt:
- ExtensionResource
- Sequence
Range:
Description: Specifies whether to use range-based sharding to download files from the origin.
Value:
Fn::GetAtt:
- ExtensionResource
- Range
RangeChunkSize:
Description: The size of each range shard.
Value:
Fn::GetAtt:
- ExtensionResource
- RangeChunkSize
OriginReadTimeout:
Description: The origin read timeout in seconds.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginReadTimeout
OriginHost:
Description: The HOST header in the origin rules request.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHost
OriginHttpPort:
Description: The origin server port for origin rules requests over HTTP.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginHttpPort
OriginMtls:
Description: Specifies whether mTLS is enabled.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginMtls
Follow302TargetHost:
Description: The origin host to use after a 302 redirect.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302TargetHost
OriginSni:
Description: The SNI in the origin rules request.
Value:
Fn::GetAtt:
- ExtensionResource
- OriginSni
Rule:
Description: The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.
Value:
Fn::GetAtt:
- ExtensionResource
- Rule
ConfigId:
Description: The ID of the back-to-origin rule configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- ConfigId
Follow302Enable:
Description: Specifies whether to follow 302 redirects for back-to-origin requests.
Value:
Fn::GetAtt:
- ExtensionResource
- Follow302Enable
DnsRecord:
Description: The DNS record used to overwrite the origin request.
Value:
Fn::GetAtt:
- ExtensionResource
- DnsRecord
ConfigType:
Description: The configuration type. Use this parameter to identify whether the configuration is global or a rule.
Value:
Fn::GetAtt:
- ExtensionResource
- ConfigType
SiteVersion:
Description: The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the active configuration version. The default is version 0.
Value:
Fn::GetAtt:
- ExtensionResource
- SiteVersion
RuleName:
Description: The name of the rule. This parameter is not required for global configurations.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleName
OriginVerify:
Description: Specifies whether to verify the origin server certificate.
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": "Specifies whether to enable the rule. This parameter is not required for global configurations. Valid values:\n- `on`: Enables the rule.\n- `off`: Disables the rule."
},
"AllowedValues": [
"on",
"off"
],
"Required": false
},
"Rule": {
"Type": "String",
"Description": {
"en": "The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations. Scenarios:\n- To match all incoming requests, set the value to true.\n- To match a specific request, set the value to a custom expression, such as (http.host eq \\\"video.example.com\\\")."
},
"Required": false
},
"RuleName": {
"Type": "String",
"Description": {
"en": "The name of the rule. This parameter is not required for global configurations."
},
"Required": false
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::ESA::OriginRule",
"Properties": {
"SiteId": {
"Ref": "SiteId"
},
"RuleEnable": {
"Ref": "RuleEnable"
},
"Rule": {
"Ref": "Rule"
},
"RuleName": {
"Ref": "RuleName"
}
}
}
},
"Outputs": {
"Follow302MaxTries": {
"Description": "The maximum number of 302 redirects to follow. Valid values: 1 to 5.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302MaxTries"
]
}
},
"RuleEnable": {
"Description": "Specifies whether the rule is enabled. This parameter is not required for global configurations.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleEnable"
]
}
},
"OriginHttpsPort": {
"Description": "The origin server port for back-to-origin requests over HTTPS.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHttpsPort"
]
}
},
"Follow302RetainArgs": {
"Description": "Specifies whether to retain the original request parameters.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302RetainArgs"
]
}
},
"Follow302RetainHeader": {
"Description": "Specifies whether to retain the original request headers.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302RetainHeader"
]
}
},
"OriginScheme": {
"Description": "The protocol for origin rules requests.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginScheme"
]
}
},
"Sequence": {
"Description": "The execution priority of the rule. A smaller value indicates a higher priority.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Sequence"
]
}
},
"Range": {
"Description": "Specifies whether to use range-based sharding to download files from the origin.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Range"
]
}
},
"RangeChunkSize": {
"Description": "The size of each range shard.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RangeChunkSize"
]
}
},
"OriginReadTimeout": {
"Description": "The origin read timeout in seconds.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginReadTimeout"
]
}
},
"OriginHost": {
"Description": "The HOST header in the back-to-origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHost"
]
}
},
"OriginHttpPort": {
"Description": "The origin server port for origin rules requests over HTTP.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginHttpPort"
]
}
},
"OriginMtls": {
"Description": "Specifies whether mTLS is enabled.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginMtls"
]
}
},
"Follow302TargetHost": {
"Description": "The origin host to use after a 302 redirect.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302TargetHost"
]
}
},
"OriginSni": {
"Description": "The SNI in the back-to-origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginSni"
]
}
},
"Rule": {
"Description": "The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Rule"
]
}
},
"ConfigId": {
"Description": "The ID of the origin rules rule configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConfigId"
]
}
},
"Follow302Enable": {
"Description": "Specifies whether to follow 302 redirects for origin rules requests.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Follow302Enable"
]
}
},
"DnsRecord": {
"Description": "The DNS record used to overwrite the origin request.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"DnsRecord"
]
}
},
"ConfigType": {
"Description": "The configuration type. Use this parameter to identify whether the configuration is global or a rule.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConfigType"
]
}
},
"SiteVersion": {
"Description": "The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the active configuration version. The default is version 0.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"SiteVersion"
]
}
},
"RuleName": {
"Description": "The name of the rule. This parameter is not required for global configurations.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleName"
]
}
},
"OriginVerify": {
"Description": "Specifies whether to verify the origin server certificate.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"OriginVerify"
]
}
}
}
}