Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ESA::HttpResponseHeaderModificationRule

Última atualização: Jun 27, 2026

O tipo de recurso ALIYUN::ESA::HttpResponseHeaderModificationRule cria uma configuração para modificar cabeçalhos de resposta HTTP.

Sintaxe

{
  "Type": "ALIYUN::ESA::HttpResponseHeaderModificationRule",
  "Properties": {
    "ResponseHeaderModification": List,
    "SiteId": Integer,
    "RuleEnable": String,
    "Rule": String,
    "RuleName": String,
    "Sequence": Integer,
    "SiteVersion": Integer
  }
}

Propriedades

Nome da propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

ResponseHeaderModification

List

Sim

Sim

Modifica o cabeçalho de resposta.

Suporta operações de adição, exclusão e modificação. Para mais informações, consulte Propriedades de ResponseHeaderModification.

SiteId

Integer

Sim

Não

ID do site.

Nenhuma

RuleEnable

String

Não

Sim

Chave da regra.

Parâmetro opcional para configurações globais. Valores válidos:

  • On: Ativado

  • Off: Desativado.

Rule

String

Não

Sim

Conteúdo da regra.

Usa uma expressão condicional para corresponder às solicitações do usuário. Parâmetro opcional para configurações globais. Dois cenários são suportados:

  • Para corresponder a todas as solicitações recebidas, defina o valor como true.

  • Para corresponder a solicitações específicas, defina o valor como uma expressão personalizada, como (http.host eq "video.example.com").

RuleName

String

Não

Sim

Nome da regra.

Parâmetro opcional para configurações globais.

Sequence

Integer

Não

Sim

Ordem de execução da regra.

Um valor menor indica maior prioridade de execução.

SiteVersion

Integer

Não

Não

Número da versão da configuração do site.

Para sites com gerenciamento de versão de configuração ativado, use este parâmetro para especificar a versão do site onde a configuração terá efeito. O valor padrão é 0.

Sintaxe de ResponseHeaderModification

"ResponseHeaderModification": [
  {
    "Type": String,
    "Value": String,
    "Operation": String,
    "Name": String
  }
]

Propriedades de ResponseHeaderModification

Nome da propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

Name

String

Sim

Sim

Nome do cabeçalho de resposta.

Nenhuma

Operation

String

Sim

Sim

Operação.

Valores válidos:

  • add

  • del: excluir

  • Modify

Type

String

Não

Sim

Tipo de valor.

Valores válidos:

  • static: modo estático.

  • dynamic: modo dinâmico.

Value

String

Não

Sim

Valor do cabeçalho de resposta.

Nenhuma

Valores de retorno

Fn::GetAtt

  • RuleEnable: Indica se a regra está ativada.

  • ResponseHeaderModification: Configuração de modificação do cabeçalho de resposta.

  • Sequence: Ordem de execução da regra.

  • Rule: Conteúdo da regra.

  • ConfigId: ID da configuração.

  • SiteVersion: Número da versão da configuração do site.

  • ConfigType: Tipo de configuração.

  • RuleName: Nome da regra.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: The site ID.
    Required: true
  ResponseHeaderModification:
    AssociationPropertyMetadata:
      Parameters:
        Type:
          Type: String
          Description:
            en: |-
              The value type. Value range:
              - `static`: Static mode.
              - `dynamic`: Dynamic mode.
          AllowedValues:
            - static
            - dynamic
          Required: false
        Value:
          Type: String
          Description:
            en: The response header value.
          Required: false
        Operation:
          Type: String
          Description:
            en: |-
              Operation method. Possible values:
              - `add`: Add
              - `del`: Delete
              - `modify`: Modify.
          AllowedValues:
            - add
            - del
            - modify
          Required: true
        Name:
          Type: String
          Description:
            en: The response header name.
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: Modify response headers, supporting add, delete, and modify operations.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::HttpResponseHeaderModificationRule
    Properties:
      SiteId:
        Ref: SiteId
      ResponseHeaderModification:
        Ref: ResponseHeaderModification
Outputs:
  RuleEnable:
    Description: Rule switch. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  ResponseHeaderModification:
    Description: Modify response headers, supporting add, delete, and modify operations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResponseHeaderModification
  Sequence:
    Description: Order of rule execution. The smaller the value, the higher the priority for execution.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  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: Config Id.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  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
  ConfigType:
    Description: The configuration type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  RuleName:
    Description: Rule name. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The site ID."
      },
      "Required": true
    },
    "ResponseHeaderModification": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Type": {
            "Type": "String",
            "Description": {
              "en": "The value type. Value range:\n- `static`: Static mode.\n- `dynamic`: Dynamic mode."
            },
            "AllowedValues": [
              "static",
              "dynamic"
            ],
            "Required": false
          },
          "Value": {
            "Type": "String",
            "Description": {
              "en": "The response header value."
            },
            "Required": false
          },
          "Operation": {
            "Type": "String",
            "Description": {
              "en": "Operation method. Possible values:\n- `add`: Add\n- `del`: Delete\n- `modify`: Modify."
            },
            "AllowedValues": [
              "add",
              "del",
              "modify"
            ],
            "Required": true
          },
          "Name": {
            "Type": "String",
            "Description": {
              "en": "The response header name."
            },
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "Modify response headers, supporting add, delete, and modify operations."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::HttpResponseHeaderModificationRule",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "ResponseHeaderModification": {
          "Ref": "ResponseHeaderModification"
        }
      }
    }
  },
  "Outputs": {
    "RuleEnable": {
      "Description": "Rule switch. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "ResponseHeaderModification": {
      "Description": "Modify response headers, supporting add, delete, and modify operations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResponseHeaderModification"
        ]
      }
    },
    "Sequence": {
      "Description": "Order of rule execution. The smaller the value, the higher the priority for execution.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "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": "Config Id.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "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"
        ]
      }
    },
    "ConfigType": {
      "Description": "The configuration type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "RuleName": {
      "Description": "Rule name. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    }
  }
}