By default, Dynamic Content Delivery Network (DCDN) supports request headers such as client IP addresses. You can also configure custom request headers. Alibaba Cloud allows you to rewrite HTTP headers in back-to-origin requests based on your business requirements.
Background information
HTTP request headers are a component of the header section in requests that are transmitted over HTTP. HTTP request headers include specific parameters that are sent to servers.
When points of presence (POPs) retrieve the requested resources from an origin server, the origin server can obtain information that is included in request headers. Alibaba Cloud CDN allows you to rewrite HTTP headers in back-to-origin requests. The information that is included in request headers is passed to the origin server to meet specific business requirements. For example, you can configure the X-Forwarded-For (XFF) header to pass client IP addresses to your origin server.
For information about how the origin server obtains the IP address of a client from the XFF header in the back-to-origin request, see Retrieve the originating IP addresses of clients.
Usage notes
If the value of an HTTP request header is a variable, a specific value is assigned to the variable when the variable is used. The following table describes available variables.
Origin HTTP header | Description |
$remote_addr | Adds a header that passes the client IP address to the origin server. |
Procedure
Log on to the DCDN console.
In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name whose acceleration region you want to change and click Configure.
In the left-side navigation tree of the domain name, click Origin Fetch.
Click the Custom Request Header tab.
Click Add.
In the Custom HTTP Response Header dialog box, set Parameter and Value.
Parameter
Example
Description
Parameter
Custom Request Header
You can select Custom Request Header or a preset header.
Custom Parameter
Content-Type
Set the value to Content-Type.
Value
text/html
You can specify one or more values for an origin header. Separate multiple values with commas (,).
Click OK.