You can add, modify, or delete HTTP headers in requests that Alibaba Cloud DCDN Points of Presence (POPs) send to your origin server. DCDN forwards standard headers such as the client IP address by default, and you can customize additional headers to meet your business requirements.
Background information
A request header is part of an HTTP request message that carries specific parameters to a server.
When an DCDN node requests resources from an origin server, the origin server can access the information carried in the origin request headers. You can use this feature to modify the HTTP headers of origin requests to pass specific parameters to the origin server and meet specific business requirements. For example, you can use the X-Forwarded-For header to pass the real client IP address to the origin server.
To learn how an origin server retrieves the client IP address from the X-Forwarded-For header, see Retrieve the originating IP addresses of clients.
Considerations
If you set the value of an incoming request header to a variable, DCDN replaces it with the actual value at runtime. The following table lists the supported variables.
|
Origin header |
Description |
|
$remote_addr |
The client IP address. |
Procedure
-
Log on to the DCDN console.
-
In the left-side navigation pane, click Domain Names.
-
On the Domain Names page, find the target domain name and click Configure.
-
In the left-side navigation tree of the domain name, click Origin Fetch.
-
Click the Modify Incoming Request Header tab.
-
Click Add.
-
In the Add Custom HTTP Header dialog box, select a Parameter and set its Value.

Parameter
Description
Example
Parameter
Select Custom Request Header or a preset header.
Custom Request Header
Custom Parameter
The custom request header name.
Content-Type
Value
-
You can specify multiple values separated by commas (,).
-
When the value is
null, the incoming request header is deleted.
text/html
Rule Condition
A rule condition allows a rule to be applied only when a request meets specific criteria.
-
Do not use: Disables conditional rules.
-
You can add or edit conditional rules in the Rules engine.
-
-
Click OK.