All Products
Search
Document Center

Anti-DDoS:ModifyHeaders

Last Updated:Mar 31, 2026

Modifies custom headers for a domain on an Anti-DDoS Pro 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 resource group.

Note
  • To find the current resource group of an instance before changing it, call the ListResources operation.

rg-acfmz6jbof5****

Domain

string

Yes

The domain of the website.

Note

A website service forwarding rule must be configured for the domain. You can call the DescribeDomains operation to query all your domains.

example.aliyundoc.com

CustomHeaders

string

Yes

The custom header, specified as a key-value pair. The key is the header name and the value is the header value. You can specify up to 5 key-value pairs. The total length cannot exceed 200 characters.

Important:

    • X-Forwarded-ClientSrcPort: Used by default to retrieve the client port that accesses the Layer 7 engine of Anti-DDoS Pro.

    • X-Forwarded-ProxyPort: Used by default to retrieve the listening port of the Layer 7 engine of Anti-DDoS Pro.

    • X-Forwarded-For: Used by default to retrieve the client IP address that accesses the Layer 7 engine of Anti-DDoS Pro.

  • Do not use standard HTTP header fields (such as host, user-agent, connection, and upgrade) or common 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) as they will overwrite the original header values in requests.

Note

To use the X-Forwarded-ClientSrcPort key to retrieve the client port that accesses the Layer 7 engine of Anti-DDoS Pro, set the value to "".

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

EmbeddedHeaders

string

No

The forwarding configuration for request headers. This parameter is a JSON string of key-value pairs where the key is the header field name and the value is a boolean. Set the value to true to enable forwarding or false to disable it.

Field description:

X-Client-IP: Forwards the client's real IP address.

X-True-IP: Forwards the client's connection IP address.

Web-Server-Type: Informs the back-end server about the type of front-end web server or proxy that is handling the request.

WL-Proxy-Client-IP: A request header specific to Oracle WebLogic Server that provides the same functionality as X-Client-IP.

X-Forwarded-Proto: Indicates the protocol used for the connection between the client and the first proxy.

Important:

  • Supported Headers: The configuration supports only the five preset header fields listed above.

  • Default settings: All the listed header fields are enabled by default. To make changes, you must explicitly set the corresponding value to false.

{"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

Response parameters.

RequestId

string

The ID of the request. This is a unique identifier generated by Alibaba Cloud for the request. You can use this ID to troubleshoot and locate 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.