Modifies the configurations of a specified 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 the 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 that you add to WAF.

InstanceId String Yes waf_elasticity-cn-0xldbqt****

The ID of the WAF instance.

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

Specifies whether to configure a Layer 7 proxy, such as Anti-DDoS Pro, Anti-DDoS Premium, or CDN, to filter inbound traffic before the traffic is forwarded to the WAF instance. Valid values:

  • 0: A Layer 7 proxy is not configured.
  • 1: A Layer 7 proxy is configured.
SourceIps String Yes ["1.1.1.1", "2.2.2.2"]

The IP addresses of the origin servers or a back-to-origin domain name.

Note You can specify the IP addresses of the origin servers or a back-to-origin domain name.
  • You can specify a maximum of 20 IP addresses. Separate more than one IP address with commas (,).
  • You can specify only one back-to-origin domain name.
LoadBalancing Integer No 0

The load balancing algorithm that is used to forward requests to the origin servers. Valid values:

  • 0: IP hash
  • 1: round robin
HttpPort String No [80]

The HTTP ports. Separate more than one port with commas (,).

Note Set this parameter only when you want to use HTTP. You must configure at least one of the HttpPort and HttpsPort parameters.
HttpsPort String No [443]

The HTTPS ports. Separate more than one port with commas (,).

Note Set this parameter only when you want to use HTTPS. You must configure at least one of the HttpPort and HttpsPort parameters.
Http2Port String No [443]

The HTTP/2 ports. Separate more than one port with commas (,).

HttpsRedirect Integer No 0

Specifies whether to enable the feature of redirecting HTTP requests to HTTPS requests. Valid values:

  • 0: disabled (default)
  • 1: enabled
Note This parameter is required only when the domain name uses HTTPS. After you enable this feature, the HTTP requests are redirected to HTTPS port 443.
HttpToUserIp Integer No 0

Specifies whether to enable the HTTP back-to-origin feature. After this feature is enabled, WAF uses HTTP to forward HTTPS requests to the origin servers. By default, port 80 is used. Valid values:

  • 0: disabled (default)
  • 1: enabled
Note If your website does not support HTTPS access, you can enable the HTTP back-to-origin feature to allow HTTPS access by using WAF.
LogHeaders String No [{"k":"wafmark","v":"test"}]

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

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

WAF automatically adds the custom header and value pair to the headers of these requests. This way, the requests that pass through WAF are marked.

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

The type of the cluster to which the WAF instance belongs. Valid values:

  • 0: shared cluster (default)
  • 1: exclusive cluster
ConnectionTime Integer No 5

The connection timeout period for WAF exclusive clusters. Unit: seconds.

ReadTime Integer No 120

The write timeout period for WAF exclusive clusters.

WriteTime Integer No 120

The read timeout period for WAF exclusive clusters.

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
&Domain=www.example.com
&InstanceId=waf_elasticity-cn-0xldbqt****
&IsAccessProduct=0
&SourceIps=["1.1.1.1", "2.2.2.2"]
&<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.