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
An HTTP request header is part of an HTTP request message and is used to pass specific parameter information to a server.
When a DCDN point of presence (POP) sends a request to an origin server to retrieve resources, the origin server can access the information in the origin request header. You can use this feature to rewrite HTTP header information in origin requests and send specific parameters to your origin server.
To learn how an origin server retrieves the real client IP address from the X-Forwarded-For header in an origin request, see Obtain the real IP address of a client.
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 identifies various parameter information in a user request. This determines whether a configuration takes effect for that request.
Do not use: Does not use a rule condition.
To add or edit rule conditions, manage them in the Rules Engine.
Click OK.