你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

Microsoft。网络前门/规则引擎 2026-04-01

Bicep 资源定义

可以使用目标操作部署 frontDoors/rulesEngines 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志。

资源格式

若要创建 Microsoft.Network/frontDoors/rulesEngines 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Network/frontDoors/rulesEngines@2026-04-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    rules: [
      {
        action: {
          requestHeaderActions: [
            {
              headerActionType: 'string'
              headerName: 'string'
              value: 'string'
            }
          ]
          responseHeaderActions: [
            {
              headerActionType: 'string'
              headerName: 'string'
              value: 'string'
            }
          ]
          routeConfigurationOverride: {
            @odata.type: 'string'
            // For remaining properties, see RouteConfiguration objects
          }
        }
        matchConditions: [
          {
            negateCondition: bool
            rulesEngineMatchValue: [
              'string'
            ]
            rulesEngineMatchVariable: 'string'
            rulesEngineOperator: 'string'
            selector: 'string'
            transforms: [
              'string'
            ]
          }
        ]
        matchProcessingBehavior: 'string'
        name: 'string'
        priority: int
      }
    ]
  }
}

RouteConfiguration 对象

设置 @odata.type 属性以指定对象的类型。

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,请使用:

{
  @odata.type: '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration'
  backendPool: {
    id: 'string'
  }
  cacheConfiguration: {
    cacheDuration: 'string'
    dynamicCompression: 'string'
    queryParameters: 'string'
    queryParameterStripDirective: 'string'
  }
  customForwardingPath: 'string'
  forwardingProtocol: 'string'
}

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,请使用:

{
  @odata.type: '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration'
  customFragment: 'string'
  customHost: 'string'
  customPath: 'string'
  customQueryString: 'string'
  redirectProtocol: 'string'
  redirectType: 'string'
}

属性值

Microsoft.Network/frontDoors/rulesEngines

Name Description 价值
name 资源名称 string

约束:
最小长度 = 1
最大长度 = 90
模式 = ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$ (必需)
父级 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。

有关详细信息,请参阅 父资源外部的子资源。
类型资源的符号名称:frontDoors
性能 规则引擎配置的属性。 规则EngineProperties

CacheConfiguration

Name Description 价值
cacheDuration 需要缓存内容的持续时间。 允许的格式采用 ISO 8601 格式(http://en.wikipedia.org/wiki/ISO_8601#Durations)。 HTTP 要求该值不超过一年 字符串
dynamicCompression 压缩 是否对缓存内容使用动态压缩 'Disabled'
'Enabled'
queryParameters 查询参数 要包含或排除的查询参数(逗号分隔)。 字符串
queryParameterStrip指令 在形成缓存密钥时处理 URL 查询词。 “StripAll”
“StripAllExcept”
“StripNone”
“StripOnly”

转发配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”(必需)
后端池 对此规则路由到的 BackendPool 的引用。 子资源
cacheConfiguration 与此规则关联的缓存配置。 CacheConfiguration
customForwardingPath 用于重写此规则匹配的资源路径的自定义路径。 留空以使用传入路径。 字符串
forwardingProtocol 将流量转发到后端时,此规则将使用协议。 'HttpOnly'
'HttpsOnly'
'MatchRequest'

HeaderAction

Name Description 价值
headerAction类型 要应用于标头的操作类型。 'Append'
“Delete”
“Overwrite”(必需)
headerName 此操作将应用到的标头的名称。 string (必需)
值 要更新给定标头名称的值。 如果 actionType 为 Delete,则不使用此值。 字符串

重定向配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)
customFragment 要添加到重定向 URL 的片段。 片段是 #之后 URL 的一部分。 请勿包含 #。 字符串
定制主机 要重定向的主机。 将传入主机保留为空,以将传入主机用作目标主机。 字符串
customPath 要重定向的完整路径。 路径不能为空,必须以 /开头。 将传入路径保留为空,以用作目标路径。 字符串
customQueryString 要放置在重定向 URL 中的查询字符串集。 设置此值将替换任何现有查询字符串;保留空以保留传入的查询字符串。 查询字符串必须采用 <key>=<value> 格式。 第一个? 并且会自动添加 &,因此不要在前面包含它们,但使用 &分隔多个查询字符串。 字符串
重定向协议 将流量重定向到的目标的协议 'HttpOnly'
'HttpsOnly'
'MatchRequest'
重定向类型 重定向流量时规则将使用的重定向类型。 “Found”
'Moved'
'PermanentRedirect'
“TemporaryRedirect”

路由配置

Name Description 价值
@odata.type 对于 forwardingConfiguration ,请设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”。 对于 redirectConfiguration 类型,设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”。 “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”
“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)

规则EngineAction

Name Description 价值
requestHeader作 要从 AFD 到源的请求中应用的标头操作列表。 HeaderAction[]
responseHeaderActions 要从 AFD 响应应用到客户端的标头操作的列表。 HeaderAction[]
routeConfigurationOverride 重写路由配置。 路由配置

规则EngineMatchCondition

Name Description 价值
negate条件 描述这是否为否定条件 bool
rulesEngineMatchValue 匹配要匹配的值。 运算符将应用于此处具有 OR 语义的每个值。 如果其中任何一个匹配变量与给定运算符匹配,则此匹配条件被视为匹配。 string[] (必需)
rulesEngineMatchVariable 匹配变量 “IsMobile”
“PostArgs”
“QueryString”
“RemoteAddr”
“RequestBody”
'RequestFilename'
'RequestFilenameExtension'
“RequestHeader”
“RequestMethod”
“RequestPath”
'RequestScheme'
“RequestUri”(必需)
rulesEngineOperator 描述要应用于匹配条件的运算符。 “Any”
“BeginsWith”
'Contains'
'EndsWith'
“Equal”
“GeoMatch”
“GreaterThan”
“GreaterThanOrEqual”
“IPMatch”
“LessThan”
“LessThanOrEqual”(必需)
选择器 要匹配的 RequestHeader 或 RequestBody 中的选择器的名称 字符串
变换 转换列表 包含任一项的字符串数组:
“小写”
“RemoveNulls”
“Trim”
“大写”
“UrlDecode”
“UrlEncode”

规则EngineProperties

Name Description 价值
rules 定义特定规则引擎配置的规则列表。 规则EngineRule[]

规则EngineRule

Name Description 价值
操作 如果满足所有匹配条件,则对请求和响应执行的操作。 RulesEngineAction (必需)
匹配条件 必须满足的匹配条件列表,以便运行此规则的操作。 没有匹配条件意味着操作将始终运行。 RulesEngineMatchCondition[]
matchProcessingBehavior 如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。 “Continue”
'Stop'
name 要引用此特定规则的名称。 string (必需)
priority 分配给此规则的优先级。 int (必需)

子资源

Name Description 价值
id 资源标识符。 字符串

ARM 模板资源定义

可以使用目标操作部署 frontDoors/rulesEngines 资源类型:

用法示例

资源格式

若要创建 Microsoft.Network/frontDoors/rulesEngines 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Network/frontDoors/rulesEngines",
  "apiVersion": "2026-04-01",
  "name": "string",
  "properties": {
    "rules": [
      {
        "action": {
          "requestHeaderActions": [
            {
              "headerActionType": "string",
              "headerName": "string",
              "value": "string"
            }
          ],
          "responseHeaderActions": [
            {
              "headerActionType": "string",
              "headerName": "string",
              "value": "string"
            }
          ],
          "routeConfigurationOverride": {
            "@odata.type": "string"
            // For remaining properties, see RouteConfiguration objects
          }
        },
        "matchConditions": [
          {
            "negateCondition": "bool",
            "rulesEngineMatchValue": [ "string" ],
            "rulesEngineMatchVariable": "string",
            "rulesEngineOperator": "string",
            "selector": "string",
            "transforms": [ "string" ]
          }
        ],
        "matchProcessingBehavior": "string",
        "name": "string",
        "priority": "int"
      }
    ]
  }
}

RouteConfiguration 对象

设置 @odata.type 属性以指定对象的类型。

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,请使用:

{
  "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration",
  "backendPool": {
    "id": "string"
  },
  "cacheConfiguration": {
    "cacheDuration": "string",
    "dynamicCompression": "string",
    "queryParameters": "string",
    "queryParameterStripDirective": "string"
  },
  "customForwardingPath": "string",
  "forwardingProtocol": "string"
}

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,请使用:

{
  "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration",
  "customFragment": "string",
  "customHost": "string",
  "customPath": "string",
  "customQueryString": "string",
  "redirectProtocol": "string",
  "redirectType": "string"
}

属性值

Microsoft.Network/frontDoors/rulesEngines

Name Description 价值
apiVersion API 版本 '2026-04-01'
name 资源名称 string

约束:
最小长度 = 1
最大长度 = 90
模式 = ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$ (必需)
性能 规则引擎配置的属性。 规则EngineProperties
类型 资源类型 “Microsoft.Network/frontDoors/rulesEngines”

CacheConfiguration

Name Description 价值
cacheDuration 需要缓存内容的持续时间。 允许的格式采用 ISO 8601 格式(http://en.wikipedia.org/wiki/ISO_8601#Durations)。 HTTP 要求该值不超过一年 字符串
dynamicCompression 压缩 是否对缓存内容使用动态压缩 'Disabled'
'Enabled'
queryParameters 查询参数 要包含或排除的查询参数(逗号分隔)。 字符串
queryParameterStrip指令 在形成缓存密钥时处理 URL 查询词。 “StripAll”
“StripAllExcept”
“StripNone”
“StripOnly”

转发配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”(必需)
后端池 对此规则路由到的 BackendPool 的引用。 子资源
cacheConfiguration 与此规则关联的缓存配置。 CacheConfiguration
customForwardingPath 用于重写此规则匹配的资源路径的自定义路径。 留空以使用传入路径。 字符串
forwardingProtocol 将流量转发到后端时,此规则将使用协议。 'HttpOnly'
'HttpsOnly'
'MatchRequest'

HeaderAction

Name Description 价值
headerAction类型 要应用于标头的操作类型。 'Append'
“Delete”
“Overwrite”(必需)
headerName 此操作将应用到的标头的名称。 string (必需)
值 要更新给定标头名称的值。 如果 actionType 为 Delete,则不使用此值。 字符串

重定向配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)
customFragment 要添加到重定向 URL 的片段。 片段是 #之后 URL 的一部分。 请勿包含 #。 字符串
定制主机 要重定向的主机。 将传入主机保留为空,以将传入主机用作目标主机。 字符串
customPath 要重定向的完整路径。 路径不能为空,必须以 /开头。 将传入路径保留为空,以用作目标路径。 字符串
customQueryString 要放置在重定向 URL 中的查询字符串集。 设置此值将替换任何现有查询字符串;保留空以保留传入的查询字符串。 查询字符串必须采用 <key>=<value> 格式。 第一个? 并且会自动添加 &,因此不要在前面包含它们,但使用 &分隔多个查询字符串。 字符串
重定向协议 将流量重定向到的目标的协议 'HttpOnly'
'HttpsOnly'
'MatchRequest'
重定向类型 重定向流量时规则将使用的重定向类型。 “Found”
'Moved'
'PermanentRedirect'
“TemporaryRedirect”

路由配置

Name Description 价值
@odata.type 对于 forwardingConfiguration ,请设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”。 对于 redirectConfiguration 类型,设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”。 “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”
“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)

规则EngineAction

Name Description 价值
requestHeader作 要从 AFD 到源的请求中应用的标头操作列表。 HeaderAction[]
responseHeaderActions 要从 AFD 响应应用到客户端的标头操作的列表。 HeaderAction[]
routeConfigurationOverride 重写路由配置。 路由配置

规则EngineMatchCondition

Name Description 价值
negate条件 描述这是否为否定条件 bool
rulesEngineMatchValue 匹配要匹配的值。 运算符将应用于此处具有 OR 语义的每个值。 如果其中任何一个匹配变量与给定运算符匹配,则此匹配条件被视为匹配。 string[] (必需)
rulesEngineMatchVariable 匹配变量 “IsMobile”
“PostArgs”
“QueryString”
“RemoteAddr”
“RequestBody”
'RequestFilename'
'RequestFilenameExtension'
“RequestHeader”
“RequestMethod”
“RequestPath”
'RequestScheme'
“RequestUri”(必需)
rulesEngineOperator 描述要应用于匹配条件的运算符。 “Any”
“BeginsWith”
'Contains'
'EndsWith'
“Equal”
“GeoMatch”
“GreaterThan”
“GreaterThanOrEqual”
“IPMatch”
“LessThan”
“LessThanOrEqual”(必需)
选择器 要匹配的 RequestHeader 或 RequestBody 中的选择器的名称 字符串
变换 转换列表 包含任一项的字符串数组:
“小写”
“RemoveNulls”
“Trim”
“大写”
“UrlDecode”
“UrlEncode”

规则EngineProperties

Name Description 价值
rules 定义特定规则引擎配置的规则列表。 规则EngineRule[]

规则EngineRule

Name Description 价值
操作 如果满足所有匹配条件,则对请求和响应执行的操作。 RulesEngineAction (必需)
匹配条件 必须满足的匹配条件列表,以便运行此规则的操作。 没有匹配条件意味着操作将始终运行。 RulesEngineMatchCondition[]
matchProcessingBehavior 如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。 “Continue”
'Stop'
name 要引用此特定规则的名称。 string (必需)
priority 分配给此规则的优先级。 int (必需)

子资源

Name Description 价值
id 资源标识符。 字符串

Terraform (AzAPI 提供程序)资源定义

可以使用目标操作部署 frontDoors/rulesEngines 资源类型:

  • 资源组 关于每个API版本中变更属性的列表,请参见 更改日志。

用法示例

Terraform 示例

部署 Azure Front Door(经典)规则引擎配置和规则的基本示例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azurerm" {
  features {
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

locals {
  backend_name        = "backend-bing"
  endpoint_name       = "frontend-endpoint"
  health_probe_name   = "health-probe"
  load_balancing_name = "load-balancing-setting"
}

resource "azurerm_frontdoor" "test" {
  name                = "acctest-FD-test"
  resource_group_name = azapi_resource.resourceGroup.name

  backend_pool_settings {
    enforce_backend_pools_certificate_name_check = false
  }

  routing_rule {
    name               = "routing-rule"
    accepted_protocols = ["Http", "Https"]
    patterns_to_match  = ["/*"]
    frontend_endpoints = [local.endpoint_name]
    forwarding_configuration {
      forwarding_protocol = "MatchRequest"
      backend_pool_name   = local.backend_name
    }
  }

  backend_pool_load_balancing {
    name = local.load_balancing_name
  }

  backend_pool_health_probe {
    name = local.health_probe_name
  }

  backend_pool {
    name = local.backend_name
    backend {
      host_header = "www.bing.com"
      address     = "www.bing.com"
      http_port   = 80
      https_port  = 443
    }

    load_balancing_name = local.load_balancing_name
    health_probe_name   = local.health_probe_name
  }

  frontend_endpoint {
    name      = local.endpoint_name
    host_name = "acctest-FD-test.azurefd.net"
  }
}

resource "azapi_resource" "rulesEngine" {
  type      = "Microsoft.Network/frontDoors/rulesEngines@2020-05-01"
  parent_id = azurerm_frontdoor.test.id
  name      = var.resource_name
  body = {
    properties = {
      rules = [
        {
          name     = var.resource_name
          priority = 0
          action = {
            routeConfigurationOverride = {
              redirectType     = "Found"
              redirectProtocol = "HttpsOnly"
              customHost       = "customhost.org"
              "@odata.type"    = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration"
            }
          }
          matchProcessingBehavior = "Continue"
        }
      ]
    }
  }
}

资源格式

若要创建 Microsoft.Network/frontDoors/rulesEngines 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/frontDoors/rulesEngines@2026-04-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      rules = [
        {
          action = {
            requestHeaderActions = [
              {
                headerActionType = "string"
                headerName = "string"
                value = "string"
              }
            ]
            responseHeaderActions = [
              {
                headerActionType = "string"
                headerName = "string"
                value = "string"
              }
            ]
            routeConfigurationOverride = {
              @odata.type = "string"
              // For remaining properties, see RouteConfiguration objects
            }
          }
          matchConditions = [
            {
              negateCondition = bool
              rulesEngineMatchValue = [
                "string"
              ]
              rulesEngineMatchVariable = "string"
              rulesEngineOperator = "string"
              selector = "string"
              transforms = [
                "string"
              ]
            }
          ]
          matchProcessingBehavior = "string"
          name = "string"
          priority = int
        }
      ]
    }
  }
}

RouteConfiguration 对象

设置 @odata.type 属性以指定对象的类型。

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,请使用:

{
  @odata.type = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration"
  backendPool = {
    id = "string"
  }
  cacheConfiguration = {
    cacheDuration = "string"
    dynamicCompression = "string"
    queryParameters = "string"
    queryParameterStripDirective = "string"
  }
  customForwardingPath = "string"
  forwardingProtocol = "string"
}

对于 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,请使用:

{
  @odata.type = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration"
  customFragment = "string"
  customHost = "string"
  customPath = "string"
  customQueryString = "string"
  redirectProtocol = "string"
  redirectType = "string"
}

属性值

Microsoft.Network/frontDoors/rulesEngines

Name Description 价值
name 资源名称 string

约束:
最小长度 = 1
最大长度 = 90
模式 = ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$ (必需)
parent_id 此资源的父资源的 ID。 类型资源的 ID:frontDoors
性能 规则引擎配置的属性。 规则EngineProperties
类型 资源类型 “Microsoft。网络/前门/rulesEngines@2026-04-01”

CacheConfiguration

Name Description 价值
cacheDuration 需要缓存内容的持续时间。 允许的格式采用 ISO 8601 格式(http://en.wikipedia.org/wiki/ISO_8601#Durations)。 HTTP 要求该值不超过一年 字符串
dynamicCompression 压缩 是否对缓存内容使用动态压缩 'Disabled'
'Enabled'
queryParameters 查询参数 要包含或排除的查询参数(逗号分隔)。 字符串
queryParameterStrip指令 在形成缓存密钥时处理 URL 查询词。 “StripAll”
“StripAllExcept”
“StripNone”
“StripOnly”

转发配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”(必需)
后端池 对此规则路由到的 BackendPool 的引用。 子资源
cacheConfiguration 与此规则关联的缓存配置。 CacheConfiguration
customForwardingPath 用于重写此规则匹配的资源路径的自定义路径。 留空以使用传入路径。 字符串
forwardingProtocol 将流量转发到后端时,此规则将使用协议。 'HttpOnly'
'HttpsOnly'
'MatchRequest'

HeaderAction

Name Description 价值
headerAction类型 要应用于标头的操作类型。 'Append'
“Delete”
“Overwrite”(必需)
headerName 此操作将应用到的标头的名称。 string (必需)
值 要更新给定标头名称的值。 如果 actionType 为 Delete,则不使用此值。 字符串

重定向配置

Name Description 价值
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)
customFragment 要添加到重定向 URL 的片段。 片段是 #之后 URL 的一部分。 请勿包含 #。 字符串
定制主机 要重定向的主机。 将传入主机保留为空,以将传入主机用作目标主机。 字符串
customPath 要重定向的完整路径。 路径不能为空,必须以 /开头。 将传入路径保留为空,以用作目标路径。 字符串
customQueryString 要放置在重定向 URL 中的查询字符串集。 设置此值将替换任何现有查询字符串;保留空以保留传入的查询字符串。 查询字符串必须采用 <key>=<value> 格式。 第一个? 并且会自动添加 &,因此不要在前面包含它们,但使用 &分隔多个查询字符串。 字符串
重定向协议 将流量重定向到的目标的协议 'HttpOnly'
'HttpsOnly'
'MatchRequest'
重定向类型 重定向流量时规则将使用的重定向类型。 “Found”
'Moved'
'PermanentRedirect'
“TemporaryRedirect”

路由配置

Name Description 价值
@odata.type 对于 forwardingConfiguration ,请设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”。 对于 redirectConfiguration 类型,设置为“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”。 “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration”
“#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration”(必需)

规则EngineAction

Name Description 价值
requestHeader作 要从 AFD 到源的请求中应用的标头操作列表。 HeaderAction[]
responseHeaderActions 要从 AFD 响应应用到客户端的标头操作的列表。 HeaderAction[]
routeConfigurationOverride 重写路由配置。 路由配置

规则EngineMatchCondition

Name Description 价值
negate条件 描述这是否为否定条件 bool
rulesEngineMatchValue 匹配要匹配的值。 运算符将应用于此处具有 OR 语义的每个值。 如果其中任何一个匹配变量与给定运算符匹配,则此匹配条件被视为匹配。 string[] (必需)
rulesEngineMatchVariable 匹配变量 “IsMobile”
“PostArgs”
“QueryString”
“RemoteAddr”
“RequestBody”
'RequestFilename'
'RequestFilenameExtension'
“RequestHeader”
“RequestMethod”
“RequestPath”
'RequestScheme'
“RequestUri”(必需)
rulesEngineOperator 描述要应用于匹配条件的运算符。 “Any”
“BeginsWith”
'Contains'
'EndsWith'
“Equal”
“GeoMatch”
“GreaterThan”
“GreaterThanOrEqual”
“IPMatch”
“LessThan”
“LessThanOrEqual”(必需)
选择器 要匹配的 RequestHeader 或 RequestBody 中的选择器的名称 字符串
变换 转换列表 包含任一项的字符串数组:
“小写”
“RemoveNulls”
“Trim”
“大写”
“UrlDecode”
“UrlEncode”

规则EngineProperties

Name Description 价值
rules 定义特定规则引擎配置的规则列表。 规则EngineRule[]

规则EngineRule

Name Description 价值
操作 如果满足所有匹配条件,则对请求和响应执行的操作。 RulesEngineAction (必需)
匹配条件 必须满足的匹配条件列表,以便运行此规则的操作。 没有匹配条件意味着操作将始终运行。 RulesEngineMatchCondition[]
matchProcessingBehavior 如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。 “Continue”
'Stop'
name 要引用此特定规则的名称。 string (必需)
priority 分配给此规则的优先级。 int (必需)

子资源

Name Description 价值
id 资源标识符。 字符串