You can call this operation to create layer 7 forwarding rules.

Request parameters

Name Type Required Description
Domain String Yes The domain name that you want to add.
RsType Integer Yes The type of the origin server’s address. Valid values:
  • 0: IP address.
  • 1: Domain name.
InstanceIds.N String No The ID of the Anti-DDoS Pro instance that you want to set up for the domain. If you want to set up multiple Anti-DDoS Pro instances, specify multiple parameters as follows: InstanceIds. 1, InstanceIds. 2, InstanceIds. 3, ..
Note If this parameter is not specified, the domain name is not associated with any Anti-DDoS Pro instance.
Rules String Yes The array of layer 7 rules represented as a JSON string. For more information, see Layer7Rule.
Table 1. Layer7Rule
Name Type Description
ProxyRules []ProxyRule The array of rule objects. For more information, see ProxyRule.
ProxyType String The forwarding protocol. Valid values:
  • http
  • https
  • websocket
  • websockets
Table 2. ProxyRule
Name Type Description
ProxyPort Integer The forwarding port. Valid values: 80 and 443.
RealServers []String The IP address and port of the origin server. For example, 1.1.1.1:443.

Response parameters

Name Type Description
RequestId String The GUID generated by Alibaba Cloud for the request.

Examples

Sample requests
{
  "Domain": "www.alibaba.com",
  "RsType": 1,
  "InstanceIds. 1": "xxxx",
  "Rules": "[{\"ProxyRules\":[{\"ProxyPort\":443,\"RealServers\":[\"1.1.1.1:443\"]}],\"ProxyType\":\"https\"},{\"ProxyRules\":[{\"ProxyPort\":80,\"RealServers\":[\"1.1.1.1:80\"]}],\"ProxyType\":\"http\"}]"
}
Sample responses
{
  "RequestId": "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc"
}