Domain name for API request: ga2.intl.tencentcloudapi.com.
Create a Layer 7 forwarding rule
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateForwardingRule. |
| Version | Yes | String | Common Params. The value used for this API: 2025-01-15. |
| Region | No | String | Common Params. This parameter is not required. |
| GlobalAcceleratorId | Yes | String | Global acceleration instance ID. |
| ListenerId | Yes | String | Listener ID. |
| ForwardingPolicyId | Yes | String | Policy ID. |
| RuleConditions.N | Yes | Array of RuleCondition | Layer 7 forwarding rule conditional information. Array length cannot exceed 1. |
| RuleActions.N | Yes | Array of RuleAction | Layer 7 forwarding rule behavior information. The length of the array cannot exceed 1. |
| OriginHeaders.N | No | Array of OriginHeader | Origin-pull Header information. The maximum length of the array cannot exceed 5. This field is required when RuleActions.RuleActionType is ForwardGroup. |
| EnableOriginSni | No | Boolean | Whether origin-pull sni is enabled. Default value: False This field is required when RuleActions.RuleActionType is ForwardGroup. |
| OriginSni | No | String | Origin sni. Input parameter limit: length cannot exceed 80. This field is required when EnableOriginSni is True. This field is required when RuleActions.RuleActionType is ForwardGroup. |
| OriginHost | No | String | Origin-pull host. Input parameter limit: length not exceeding 80. This field is required when RuleActions.RuleActionType is ForwardGroup. |
| ResponseHeaders.N | No | Array of ResponseHeaders | Origin response headers Array length not exceeding 5. An empty array can be passed, representing configuration clearing. |
| HideResponseHeaders.N | No | Array of HideResponseHeaders | Delete origin server response headers Array length not exceeding 5. An empty array can be passed, representing configuration clearing. |
| Parameter Name | Type | Description |
|---|---|---|
| TaskId | String | Asynchronous task ID. |
| ForwardingRuleId | String | Layer 7 forwarding rule ID. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: ga2.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateForwardingRule
<Common request parameters>
{
"GlobalAcceleratorId": "ga-80bzejka",
"ListenerId": "lsr-nd3qmz7h",
"ForwardingPolicyId": "dm-kzk3neks",
"RuleConditions": [
{
"RuleConditionType": "Path",
"RuleConditionValue": [
"/a"
]
}
],
"RuleActions": [
{
"RuleActionType": "Drop"
}
],
"OriginHeaders": [
{
"Key": "key-key",
"Value": "value-value"
}
],
"EnableOriginSni": true,
"OriginSni": "testsni",
"OriginHost": "www.bbb.com"
}
{
"Response": {
"RequestId": "f7be96f3-c499-4efe-badd-0178c2921d8f",
"TaskId": "6fa13601-49eb-4982-abee-513fbab41fc1",
"ForwardingRuleId": "rule-kfn3oc78"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InvalidParameter.InputRepeat | The input parameter %(key)s in the request has duplicate values. |
| InvalidParameterValue.AsciiCharacters | Can only be printable ASCII characters. |
| InvalidParameterValue.Empty | Parameter %(parameter)s cannot be empty. |
| InvalidParameterValue.ForwardingRulePathConflict | The Path of the Layer 7 forwarding rule duplicates an existing one. |
| InvalidParameterValue.InstanceMismatch | The instance object %(value)s has a mismatched relationship. |
| InvalidParameterValue.InternalReservedFields | |
| InvalidParameterValue.Malformed | Parameter value %(value)s of %(parameter)s is invalid. A correct and complete value is in the form of %(template)s. |
| InvalidParameterValue.SpecialCharacters | Parameter value %(value)s cannot contain special characters %(key)s. |
| InvalidParameterValue.TooLong | Parameter value %(value)s length cannot be greater than %(max_size)s. |
| MissingParameter | Parameters are missing. |
| UnsupportedOperation.ForwardGroupForwardingRuleUnsupportedDefaultEndpointGroup | Forwarding rules cannot be configured with a default terminal node group. |
| UnsupportedOperation.InstanceNotRunning | The instance is not in the running state. The current operation is not supported. |
| UnsupportedOperation.TransportLayerUnsupportedOperateForwardingPolicy | Layer-4 listeners do not support creation of forwarding policies. |
文档反馈