You can call this operation to modify the configurations of a specific domain.

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 Boolean No ModifyDomain

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

Domain String No www.example.com

The domain name that has been added to WAF.

InstanceId String No waf_elasticity-cn-0xldbqtm005

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 or CDN, to filter the inbound traffic before it is forwarded to WAF. Valid values:

  • 0: false
  • 1: true
SourceIps String No ["1.1.1.1", "2.2.2.2"]

The IP address or domain of the origin server to which the specified domain points.

Note You can add a maximum of 20 origin IP addresses to implement load balancing or specify only one origin domain. Separate origin IP addresses with commas (,). You can specify either IP addresses or a domain.
LoadBalancing String Optional 0

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

  • 0: IP hash
  • 1: Round robin
HttpPort String Yes [80]

The HTTP ports. Separate multiple ports with commas (,).

Note Set this parameter only if you want to use the HTTP protocol. You must set at least one of the HttpPort and HttpsPort parameters.
HttpsPort String Yes [443]

The HTTPS ports. Separate multiple HTTPS ports with commas (,).

Note Set this parameter only if you want to use the HTTPS protocol. You must set at least one of the HttpPort and HttpsPort parameters.
Http2Port String Yes [443]

The HTTP 2.0 ports. Separate multiple ports with commas (,).

HttpsRedirect String Optional 0

Specifies whether to redirect HTTP requests as HTTPS requests. Valid values:

  • 0: no (default)
  • 1: yes
Note This parameter is required only if the specified domain only accepts HTTPS requests. After you enable this feature, the HTTP requests are redirected to HTTPS port 443.
HttpToUserIp String Optional 0

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

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

The key-value pair that is used to mark the traffic that flows through WAF to the domain.

Set the parameter in this format: [{"k":"_key_","v":"_value_"}]. Set _key_ to a custom request header field. Set _value_ to a field value.

WAF automatically marks the requests that pass through WAF by adding the specified field and value to the headers of these requests.

Note If a request header contains the specified field, WAF overwrites the original field value with the specified value.
ClusterType String Optional 0

The type of the WAF cluster. Valid values:

  • 0: shared cluster (default)
  • 1: exclusive cluster
ConnectionTime String Optional 5

The connection timeout for an exclusive cluster. Unit: seconds.

ReadTime String Optional 120

The timeout period for an exclusive cluster write connection. Unit: seconds.

WriteTime String Optional 120

The timeout period for a read connection of the exclusive cluster. Unit: seconds.

Response parameters

Parameter Type Example Description
RequestId String D7861F61-5B61-46CE-A47C-6B19160D5EB0

The ID of the request.

Samples

Sample request

http(s)://[Endpoint]/? Action=ModifyDomain
&Domain=www.example.com
&InstanceId=waf_elasticity-cn-0xldbqtm005
&IsAccessProduct=0
&SourceIps=["1.1.1.1", "2.2.2.2"]
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes.

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