Configures a back-to-origin policy for the forwarding rule of a website.
If multiple origin servers are configured for a website that is added to Anti-DDoS Pro or Anti-DDoS Premium, you can modify the load balancing algorithms for back-to-origin traffic based on back-to-origin policies. The IP hash algorithm is used by default. You can change the algorithm to the round-robin or least response time algorithm. For more information, see the description of the Policy parameter in the "Request parameters" section of this topic.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ConfigL7RsPolicy |
The operation that you want to perform. Set the value to ConfigL7RsPolicy. |
Domain | String | Yes | www.aliyun.com |
The domain name of the website. Note A forwarding rule must be configured for the domain name. You can call the DescribeDomains operation to query the domain names for which the forwarding rules are created.
|
Policy | String | Yes | {"ProxyMode":"rr","Attributes":[{"RealServer":"1. ***. ***.1","Attribute":{"Weight":100}},{"RealServer":"2. ***. ***.2","Attribute":{"Weight":100}}]} |
The back-to-origin policy. This parameter is a string that contains a JSON struct. The JSON struct includes the following fields:
|
RegionId | String | No | cn-hangzhou |
The region ID of the instance. Valid values:
|
ResourceGroupId | String | No | rg-acfm2pz25js**** |
The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group. For more information about resource groups, see Create a resource group. |
All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.
For more information about sample requests, see the "Examples" section of this topic.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ConfigL7RsPolicy
&Domain=www.aliyun.com
&Policy={\"ProxyMode\":\"rr\",\"Attributes\":[{\"RealServer\":\"1. ***. ***.1\",\"Attribute\":{\"Weight\":100}},{\"RealServer\":\"2. ***. ***.2\",\"Attribute\":{\"Weight\":100}}]}
&<Common request parameters>
Sample success responses
XML
format
<ConfigL7RsPolicyResponse>
<RequestId>0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc</RequestId>
</ConfigL7RsPolicyResponse>
JSON
format
{
"RequestId": "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc"
}
Error codes
For a list of error codes, visit the API Error Center.