Adds a domain name to a WAF instance to enable protection.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
Call the DescribeInstance operation to query the ID of the WAF instance. |
waf_cdnsdf3**** |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| Domain |
string |
Yes |
The domain name that you want to add. |
www.aliyundoc.com |
| Listen |
object |
Yes |
The listener configuration. |
|
| HttpsPorts |
array |
No |
The HTTPS listener ports. |
|
|
integer |
No |
The HTTPS listener ports. Use the [port1,port2,...,portN] format. |
[443,8443] |
|
| HttpPorts |
array |
No |
The HTTP listener ports. |
|
|
integer |
No |
The HTTP listener ports. Use the [port1,port2,...] format. |
[80,81] |
|
| Http2Enabled |
boolean |
No |
Specifies whether to enable HTTP/2. This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
true |
| CertId |
string |
No |
The ID of the certificate to add. This parameter is available only when you specify the HttpsPorts parameter. |
123 |
| SM2Enabled |
boolean |
No |
Specifies whether to enable the SM certificate. |
true |
| SM2CertId |
string |
No |
The ID of the SM certificate to add. This parameter is available only when SM2Enabled is set to true. |
123-cn-hangzhou |
| SM2AccessOnly |
boolean |
No |
Specifies whether to allow access only from clients that use SM certificates. This parameter is available only when SM2Enabled is set to true.
|
true |
| TLSVersion |
string |
No |
The TLS version to add. This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
tlsv1 |
| EnableTLSv3 |
boolean |
No |
Specifies whether to support TLS 1.3. This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
true |
| CipherSuite |
integer |
No |
The type of the cipher suite to add. This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
2 |
| CustomCiphers |
array |
No |
The custom cipher suites to add. |
|
|
string |
No |
The custom cipher suites to add. This parameter is available only when you set CipherSuite to 99. |
["xxx","ffas"] |
|
| FocusHttps |
boolean |
No |
Specifies whether to enable an HTTPS force redirect. This parameter is available only when you specify the HttpsPorts parameter and leave the HttpPorts parameter empty. Valid values:
|
true |
| XffHeaderMode |
integer |
No |
The method that WAF uses to obtain the real IP address of a client. Valid values:
|
1 |
| XffHeaders |
array |
No |
The custom header fields that are used to obtain the client IP address. |
|
|
string |
No |
The custom header fields that are used to obtain the client IP address. Use the ["header1","header2",...] format. Note
This parameter is required only when you set XffHeaderMode to 2. |
["Client-ip","cip"] |
|
| IPv6Enabled |
boolean |
No |
Specifies whether to enable IPv6. Valid values:
|
true |
| ProtectionResource |
string |
No |
The type of the protection resource to use. Valid values:
|
share |
| ExclusiveIp |
boolean |
No |
Specifies whether to enable an exclusive IP address. This parameter is available only when you set IPv6Enabled to false and ProtectionResource to share. Valid values:
|
true |
| Redirect |
object |
Yes |
The forwarding configuration. |
|
| Backends |
array |
No |
The IP addresses or domain names of the origin servers. |
|
|
string |
No |
The IP addresses or domain names of the origin servers. You can specify only IP addresses or domain names. If you specify a domain name, it must be an IPv4 domain name. IPv6 is not supported.
|
[ "1.1.XX.XX", "2.2.XX.XX" ] |
|
| Loadbalance |
string |
Yes |
The load balancing algorithm for back-to-origin traffic. Valid values:
|
roundRobin |
| FocusHttpBackend |
boolean |
No |
Specifies whether to enable a force redirect to HTTP for back-to-origin traffic. This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
true |
| SniEnabled |
boolean |
No |
Specifies whether to enable back-to-origin Server Name Indication (SNI). This parameter is available only when you specify the HttpsPorts parameter. Valid values:
|
true |
| SniHost |
string |
No |
The value of the custom SNI field. If you do not specify this parameter, the value of the Host field in the request header is used as the value of the SNI field. In most cases, you do not need to customize the SNI. This is required only if you want WAF to use an SNI that is different from the Host field for back-to-origin requests. Note
This parameter is required only when you set SniEnabled to true. |
www.aliyundoc.com |
| RequestHeaders |
array<object> |
No |
The custom header field and value that are used to mark traffic that is processed by WAF. If you specify a custom request header, WAF automatically adds the header to requests that are forwarded to the origin server. This allows the origin server to identify requests that are forwarded by WAF. |
|
|
object |
No |
The value of this parameter is in the [{"k":"key","v":"value"}] format. key is the custom header field. value is the value of the custom header field. |
||
| Key |
string |
No |
The custom request header field. |
aaa |
| Value |
string |
No |
The value of the custom request header field. |
bbb |
| ConnectTimeout |
integer |
No |
The connection timeout. Unit: seconds. Valid values: 1 to 3600. Default value: 5. |
120 |
| ReadTimeout |
integer |
No |
The read timeout. Unit: seconds. Valid values: 1 to 3600. Default value: 120. |
200 |
| WriteTimeout |
integer |
No |
The write timeout. Unit: seconds. Valid values: 1 to 3600. Default value: 120. |
200 |
| CnameEnabled |
boolean |
No |
Specifies whether to enable public cloud disaster recovery. Valid values:
|
true |
| RoutingRules |
string |
No |
The forwarding rules for the hybrid cloud cluster. This parameter is a string that consists of a JSON array. Each element in the array is a struct that contains the following fields:
|
[ { "rs": [ "1.1.XX.XX" ], "backupRs": [ "2.2.XX.XX" ], "locationId": 535, "location": "test1111" } ] |
| Keepalive |
boolean |
No |
Specifies whether to enable persistent connections. Valid values:
|
true |
| Retry |
boolean |
No |
Specifies whether to retry forwarding requests to the origin server when the requests fail. Valid values:
|
true |
| KeepaliveRequests |
integer |
No |
The number of requests that can be reused in a persistent connection. Valid values: 60 to 1000. Default value: 1000. Note
This parameter specifies the number of requests that can be reused after a persistent connection is established. |
1000 |
| KeepaliveTimeout |
integer |
No |
The timeout of an idle persistent connection. Valid values: 1 to 60. Default value: 15. Unit: seconds. Note
This parameter specifies the duration for which a reused persistent connection can remain in the idle state before it is released. |
15 |
| XffProto |
boolean |
No |
Specifies whether to use the X-Forward-For-Proto header to pass the protocol used by WAF to the origin server. Valid values:
|
false |
| BackupBackends |
array |
No |
The IP addresses or domain names of the backup origin servers. |
|
|
string |
No |
The IP addresses or domain names of the backup origin servers. You can specify only IP addresses or domain names. If you specify a domain name, it must be an IPv4 domain name. IPv6 is not supported.
|
[ "1.1.XX.XX", "2.2.XX.XX" ] |
|
| XClientIp |
boolean |
No |
Specifies whether to allow WAF to overwrite the X-Client-IP header. Valid values:
|
true |
| XTrueIp |
boolean |
No |
Specifies whether to allow WAF to overwrite the X-True-IP header. Valid values:
|
true |
| WebServerType |
boolean |
No |
Specifies whether to allow WAF to overwrite the Web-Server-Type header. Valid values:
|
true |
| WLProxyClientIp |
boolean |
No |
Specifies whether to allow WAF to overwrite the WL-Proxy-Client-IP header. Valid values:
|
true |
| MaxBodySize |
integer |
No |
The maximum size of a request body. Valid values: 2 to 10. Default value: 2. Unit: GB. Note
This parameter is supported only by the Ultimate edition. |
2 |
| Http2Origin |
boolean |
No |
Specifies whether to enable HTTP/2 for back-to-origin traffic. Valid values:
|
true |
| Http2OriginMaxConcurrency |
integer |
No |
The maximum number of concurrent HTTP/2 back-to-origin requests. Valid values: 1 to 512. Default value: 128. |
128 |
| BackendPorts |
array<object> |
No |
The custom port configuration. |
|
|
object |
No |
The custom port configuration. |
||
| ListenPort |
integer |
No |
The listener port. |
80 |
| BackendPort |
integer |
No |
The back-to-origin port. |
80 |
| Protocol |
string |
No |
The protocol of the listener port. Valid values:
|
http |
| RegionId |
string |
Yes |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
| AccessType |
string |
No |
The access type of the WAF instance. Valid values:
|
share |
| Tag |
array<object> |
No |
A list of tags. You can add up to 20 tags. |
|
|
object |
No |
The tags of the resource. You can add up to 20 tags. |
||
| Key |
string |
No |
The tag key. |
Tagkey1 |
| Value |
string |
No |
The tag value. |
TagValue1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
D7861F61-5B61-46CE-A47C-6B19160D5EB0 |
| DomainInfo |
object |
The information about the added domain name. |
|
| Cname |
string |
The CNAME that is assigned by WAF to the domain name. |
xxxxxwww.****.com |
| Domain |
string |
The added domain name. |
www.aliyundoc.com |
| DomainId |
string |
The ID of the domain name. |
www.aliyundoc.com-waf |
Examples
Success response
JSON format
{
"RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0",
"DomainInfo": {
"Cname": "xxxxxwww.****.com",
"Domain": "www.aliyundoc.com",
"DomainId": "www.aliyundoc.com-waf"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Waf.Pullin.ResourceExsit | Access resource already exists, resource:%s. | Access resource already exists, existing resource:%s. |
| 400 | Waf.Pullin.BusinessViolation | The web services are suspected of violating regulations. If you have any questions, please submit a work order. Violating resource: %s. | |
| 400 | Waf.Pullin.Http2OriginMustOnHttp2Enable | When HTTP2 origin is enabled, HTTP2 listening must be enabled. | When HTTP2 back-to-source is enabled, HTTP2 listening must be enabled. |
| 400 | Waf.Pullin.Http2OriginMustOnKeepaliveEnable | When the HTTP2 origin is turned on, the keepalive must be turned on. | When the HTTP2 origin is turned on, the keepalive must be turned on. |
| 400 | Waf.Pullin.Http2OriginEnabledFocusHttpBackendForbidden | When HTTP2 origin is enabled, HTTP origin cannot be enabled. | When HTTP2 origin is enabled, HTTP origin cannot be enabled. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.