Modifies the configurations of a domain name.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyDomain

The operation that you want to perform. Set the value to ModifyDomain.

Domain String Yes www.example.com

The domain name whose configurations you want to modify.

Note You can call the DescribeDomainNames operation to query the domain names that are added to WAF.
InstanceId String Yes waf-cn-7pp26f1****

The ID of the Web Application Firewall (WAF) instance.

Note You can call the DescribeInstanceInfo operation to query the ID of the WAF instance.
IsAccessProduct Integer Yes 0

Specifies whether to deploy a Layer 7 proxy, which is used to filter inbound traffic before the traffic reaches the WAF instance. The supported Layer 7 proxies include Anti-DDoS Pro, Anti-DDoS Premium, and Alibaba Cloud CDN. Valid values:

  • 0: does not configure a Layer 7 proxy
  • 1: configures a Layer 7 proxy
SourceIps String No ["39.XX.XX.197"]

The address of the origin server. The address can be an IP address or a domain name. You can specify only one type of address.

  • If you use the IP address type, specify the value in the ["ip1","ip2",...] format. You can enter a maximum of 20 IP addresses.
  • If you use the domain name type, specify the value in the ["domain"] format. You can enter only one domain name.
Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns.
LoadBalancing Integer No 0

The load balancing algorithm that is used when WAF forwards requests to the origin server. Valid values:

  • 0: IP hash
  • 1: round-robin
  • 2: least time
Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns.
HttpPort String No [80]

The list of HTTP ports. Specify the value in the ["port1","port2",...] format.

Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns. If you specify this parameter, your website uses HTTP. You must specify at least one of the HttpPort and HttpsPort parameters.
HttpsPort String No [443]

The list of HTTPS ports. Specify the value in the ["port1","port2",...] format.

Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns. If you specify this parameter, your website uses HTTPS. You must specify at least one of the HttpPort and HttpsPort parameters.
Http2Port String No [443]

The list of HTTP/2 ports. Specify the value in the ["port1","port2",...] format.

Note You need to specify this parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the HttpsPort parameter is not empty. If the HttpsPort parameter is not empty, your website uses HTTPS.
HttpsRedirect Integer No 0

Specifies whether to turn on Enable HTTPS Routing. After you turn on Enable HTTPS Routing, HTTP requests are redirected to HTTPS requests on port 443, which is used by default. Valid values:

  • 0: turns off Enable HTTPS Routing. This is the default value.
  • 1: turns on Enable HTTPS Routing.
Note You need to specify this parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the HttpsPort parameter is not empty. If the HttpsPort parameter is not empty, your website uses HTTPS.
HttpToUserIp Integer No 0

Specifies whether to turn on Enable HTTP. If you turn on Enable HTTP, HTTPS requests are redirected to HTTP requests on port 80, which is used by default. Valid values:

  • 0: turns off Enable HTTP. This is the default value.
  • 1: turns on Enable HTTP.
Note You need to specify this parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the HttpsPort parameter is not empty. If the HttpsPort parameter is not empty, your website uses HTTPS.
AccessHeaderMode Integer No 0

The method that WAF uses to obtain the actual IP address of a client. Valid values:

  • 0: WAF reads the first value of the X-Forwarded-For (XFF) header field as the actual IP address of the client.
  • 1: WAF reads the value of a custom header field as the actual IP address of the client.
Note You need to specify the parameter only when the IsAccessProduct parameter is set to 1.
AccessHeaders String No ["X-Client-IP"]

The list of custom header fields that are used to obtain the actual IP address of a client. Specify the value in the ["header 1","header 2",...] format.

Note You need to specify the parameter only when the AccessHeaderMode parameter is set to 1.
LogHeaders String No [{"k":"ALIWAF-TAG","v":"Yes"}]

The key-value pair that is used to mark the requests that pass through the WAF instance.

Specify the value in the [{"k":"_key_","v":"_value_"}] format. _key_ indicates a custom header field. _value_ indicates the value of the custom header field.

WAF automatically adds the key-value pair to the headers of requests. This way, the requests that pass through WAF are identified.

Note If requests contain the custom header field, WAF overwrites the original value of the field with the specified value.
ClusterType Integer No 0

The type of WAF protection cluster. Valid values:

  • 0: shared cluster. This is the default value.
  • 1: exclusive cluster.
Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns.
ConnectionTime Integer No 5

The timeout period for connections of WAF exclusive clusters. Unit: seconds.

Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the value of the ClusterType parameter is set to 1.
ReadTime Integer No 120

The timeout period for read connections of WAF exclusive clusters. Unit: seconds.

Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the value of the ClusterType parameter is set to 1.
WriteTime Integer No 120

The timeout period for write connections of WAF exclusive clusters. Unit: seconds.

Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns and the value of the ClusterType parameter is set to 1.
AccessType String No waf-cloud-dns

The mode that is used to add the domain name. Valid values:

  • waf-cloud-dns: CNAME record mode. This is the default value.
  • waf-cloud-native: transparent proxy mode.
CloudNativeInstances String No [{"ProtocolPortConfigs":[{"Ports":[80],"Protocol":"http"}],"RedirectionTypeName":"ALB","InstanceId":"alb-s65nua68wdedsp****","IPAddressList":["182.XX.XX.113"],"CloudNativeProductName":"ALB"}]

The list of server and port configurations for the transparent proxy mode. The value is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields:

  • ProtocolPortConfigs : the list of protocol and port configurations. This field is required. Data type: array. Each element in a JSON array is a JSON struct that contains the following fields:
    • Ports : the list of ports. This field is required. Data type: array. The value is in the [port1,port2,……] format.
    • Protocol: the protocol. This field is required. Data type: string. Valid values: http and https.
  • CloudNativeProductName: the type of the cloud service instance. This field is required. Data type: string. Valid values: ECS, SLB, and ALB.
  • RedirectionTypeName : the type of traffic redirection port. This field is required. Data type: string. Valid values: ECS, SLB-L4, SLB-L7, and ALB.
  • InstanceId: the ID of the cloud service instance. This field is required. Data type: string.
  • IPAddressList: the list of public IP addresses of the cloud service instance. This field is required. Data type: array. The value is in the ["ip1","ip2",...] format.
Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-native.
IpFollowStatus Integer No 0

Specifies whether to select Use the Same Protocol if you configure both IPv4 and IPv6 addresses. If you select Use the Same Protocol, WAF forwards requests from IPv4 addresses to origin servers that use IPv4 addresses and requests from IPv6 addresses to origin servers that use IPv6 addresses. Valid values:

  • 0: clears Use the Same Protocol. This is the default value.
  • 1:selects Use the Same Protocol.
Note You need to specify the parameter only when the value of the AccessType parameter is set to waf-cloud-dns.

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 D7861F61-5B61-46CE-A47C-6B19160D5EB0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyDomain
&InstanceId=waf-cn-7pp26f1****
&Domain=www.example.com
&IsAccessProduct=0
&HttpPort=[\"80\"]
&SourceIps=[\"39.XX.XX.197\"]
&<common request parameters>

Sample success responses

XML format

<ModifyDomainResponse>
      <RequestId>D7861F61-5B61-46CE-A47C-6B19160D5EB0</RequestId>
</ModifyDomainResponse>

JSON format

{
    "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0"
}

Error codes

For a list of error codes, visit the API Error Center.