All Products
Search
Document Center

Anti-DDoS:ModifyHeaders

Last Updated:Feb 02, 2026

Modifies the custom headers for a domain name added to an Anti-DDoS Pro or Anti-DDoS Premium instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-ddoscoo:ModifyHeaders

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceGroupId

string

No

The ID of the target resource group.

Note
  • Before you change the resource group of the instance, call the ListResources operation to view the current resource group.

rg-acfmz6jbof5****

Domain

string

Yes

The domain name of your website.

Note

A website forwarding rule must be configured for the domain name. You can call the DescribeDomains operation to query all domain names.

example.aliyundoc.com

CustomHeaders

string

Yes

The key-value pairs of the custom header. The key specifies the header field and the value specifies the header value. You can specify up to five key-value pairs. The total length cannot exceed 200 characters.

Note:

  • Do not use the following default fields as custom headers.
    • X-Forwarded-ClientSrcPort: This field is used by default to retrieve the port of the client that accesses the Layer 7 DPI engine.

    • X-Forwarded-ProxyPort: This field is used by default to retrieve the listening port of the Layer 7 DPI engine.

    • X-Forwarded-For: This field is used by default to retrieve the IP address of the client that accesses the Layer 7 DPI engine.

  • Do not use standard HTTP header fields, such as host, user-agent, connection, and upgrade, or widely used custom HTTP header fields, such as x-real-ip, x-true-ip, x-client-ip, web-server-type, wl-proxy-client-ip, eagleeye-rpcid, eagleeye-traceid, x-forwarded-cluster, and x-forwarded-proto. Otherwise, the original header fields in the request are overwritten.

Note

If you set the key to X-Forwarded-ClientSrcPort to retrieve the port of the client that accesses the Layer 7 DPI engine, set the value to "".

{"X-Forwarded-ClientSrcPort":""}

EmbeddedHeaders

string

No

{"X-Client-IP":true,"X-True-IP":true,"Web-Server-Type":true,"WL-Proxy-Client-IP":true,"X-Forwarded-Proto":true}

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request. Alibaba Cloud generates a unique ID for each request. Use the ID to troubleshoot issues.

DC38A1D3-C042-5670-8394-8F6B1FA97B5E

Examples

Success response

JSON format

{
  "RequestId": "DC38A1D3-C042-5670-8394-8F6B1FA97B5E"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidEmbeddedHeaders EmbeddedHeaders parameter is invalid. The EmbeddedHeaders parameter passed in is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.