Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::DDoSPro::WebRule

Última atualização: Jun 27, 2026

Cria uma regra de encaminhamento para um site.

Sintaxe

{
  "Type": "ALIYUN::DDoSPro::WebRule",
  "Properties": {
    "RsType": Integer,
    "ResourceGroupId": String,
    "DefenseId": String,
    "Domain": String,
    "InstanceIds": List,
    "Rules": String,
    "HttpsExt": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Domain

String

Sim

Não

Nome de domínio do site a ser adicionado ao Anti-DDoS Proxy.

Nenhuma.

RsType

Integer

Sim

Não

Tipo de endereço do servidor de origem.

Valores válidos:

  • 0: endereço IP.

  • 1: nome de domínio. Use este valor quando houver proxies, como o Web Application Firewall (WAF), implantados entre o servidor de origem e a instância do Anti-DDoS Proxy. O valor corresponde ao endereço do proxy, como o CNAME fornecido pelo WAF.

Rules

String

Sim

Não

Detalhes da regra de encaminhamento.

String composta por arrays JSON. Cada elemento do array é uma estrutura JSON com os seguintes campos:

  • ProxyRules: informações do servidor de origem, incluindo porta e endereço IP. Obrigatório. Array JSON. Cada elemento é uma estrutura JSON com os seguintes campos:

    • ProxyPort: porta correspondente ao protocolo. Obrigatório. Integer.

    • RealServers: endereços IP do servidor. Obrigatório. Array de strings.

  • ProxyType: tipo de protocolo. Obrigatório. String. Valores válidos:

    • http

    • https

    • WebSocket

    • websockets

DefenseId

String

Não

Não

ID de defesa a associar à regra de encaminhamento.

Nenhuma.

HttpsExt

String

Não

Não

Configurações avançadas de HTTPS. Aplica-se apenas quando ProxyType inclui https.

String composta por uma estrutura JSON com os seguintes campos:

  • Http2https: indica se o redirecionamento forçado para HTTPS está ativado. Opcional. Integer. Valores válidos:

    • 0 (padrão): desativa o redirecionamento forçado para HTTPS.

    • 1: ative o redirecionamento forçado para HTTPS. Se o site suportar HTTP e HTTPS, todas as solicitações HTTP serão redirecionadas para HTTPS na porta 443 por padrão.

  • Https2http: indica se o redirecionamento HTTP de retorno à origem está ativado. Opcional. Integer. Valores válidos:

    • 0 (padrão): desativa o redirecionamento HTTP de retorno à origem.

    • 1: ative o redirecionamento HTTP de retorno à origem.

      Se o site não suportar redirecionamento HTTPS de retorno à origem, todas as solicitações HTTPS serão convertidas em HTTP e encaminhadas aos servidores de origem. As solicitações WebSockets serão convertidas em WebSocket e também encaminhadas à origem. Por padrão, esse redirecionamento ocorre na porta 80.

  • Http2: indica se o HTTP/2 está ativado. Opcional. Integer. Valores válidos:

    • 0 (padrão): desativa o HTTP/2.

    • 1: ative o HTTP/2.

      Defina o tipo de protocolo como HTTP/2.

InstanceIds

List

Não

Não

IDs das instâncias do Anti-DDoS Proxy a associar à regra de encaminhamento.

Nenhuma.

ResourceGroupId

String

Não

Não

ID do grupo de recursos ao qual a instância do Anti-DDoS Proxy pertence no Resource Management.

Nenhuma.

Valores de retorno

Fn::GetAtt

Domain: nome de domínio do site adicionado ao Anti-DDoS Proxy.

Exemplos

Formato YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RsType:
    Type: Number
    Description:
      en: |-
        The address type of the origin server. Valid values:
        0: IP address
        1: domain name The domain name of the origin server is returned if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the instance. In this case, the address of the proxy, such as the CNAME provided by WAF, is returned.
    Required: true
  Domain:
    Type: String
    Description:
      en: The domain name of the website that you want to add to the instance.
    Required: true
  Rules:
    Type: String
    Description:
      en: |-
        The details of the forwarding rule. The value is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields: 
        ProxyRules: the information about the origin server. The information includes the port number and IP address. This field is required and must be a JSON array. Each element in a JSON array is a JSON struct that contains the following fields: ProxyPort: the port number. This field is required and must be an integer; RealServers: the IP address. This field is required and must be a string array.
        ProxyType: the protocol type. This field is required and must be a string. Valid values: http, https, websocket, and websockets.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::DDoSPro::WebRule
    Properties:
      RsType:
        Ref: RsType
      Domain:
        Ref: Domain
      Rules:
        Ref: Rules
Outputs:
  Domain:
    Description: The domain name of the website that you want to add to the instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Domain

Formato JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RsType": {
      "Type": "Number",
      "Description": {
        "en": "The address type of the origin server. Valid values:\n0: IP address\n1: domain name The domain name of the origin server is returned if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the instance. In this case, the address of the proxy, such as the CNAME provided by WAF, is returned."
      },
      "Required": true
    },
    "Domain": {
      "Type": "String",
      "Description": {
        "en": "The domain name of the website that you want to add to the instance."
      },
      "Required": true
    },
    "Rules": {
      "Type": "String",
      "Description": {
        "en": "The details of the forwarding rule. The value is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields: \nProxyRules: the information about the origin server. The information includes the port number and IP address. This field is required and must be a JSON array. Each element in a JSON array is a JSON struct that contains the following fields: ProxyPort: the port number. This field is required and must be an integer; RealServers: the IP address. This field is required and must be a string array.\nProxyType: the protocol type. This field is required and must be a string. Valid values: http, https, websocket, and websockets."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::DDoSPro::WebRule",
      "Properties": {
        "RsType": {
          "Ref": "RsType"
        },
        "Domain": {
          "Ref": "Domain"
        },
        "Rules": {
          "Ref": "Rules"
        }
      }
    }
  },
  "Outputs": {
    "Domain": {
      "Description": "The domain name of the website that you want to add to the instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Domain"
        ]
      }
    }
  }
}