Documentation HTTP/HTTPS Settings HTTP Header Management

HTTP Header Management

Last update:2026-07-13 11:50:59

Atomile provides an HTTP header management feature that gives you flexible control over the HTTP request and response headers exchanged among CDN nodes, clients, and your origin server. This allows you to customize header behavior to optimize security, caching, and other aspects of content delivery.

Based on your needs, you can add, replace, or delete HTTP headers in four directions: CDN to Origin Request, CDN to Client Response, CDN Receives Origin Response, and CDN Receives Client Request.

How to Add HTTP Header Rules

  1. Log in to the Atomile Console and select the appropriate product.
  2. Go to Configuration, locate the domain you want to configure, and click Edit Configuration at the top or the Edit button to the right of the domain.
  3. On the Edit Configuration page, locate Protocol Settings - HTTP Headers, and click Manually Enter to create a new HTTP header rule.

Define the Effective Range for the HTTP Header Rule

Specify the scope to which the header rule applies. You can choose from the following options:

Parameter Description
All Requests Applies to all requests under the domain.
Homepage Only Applies only to requests for the root path, such as http://domain/ or https://domain/.
Specific File Types Applies to specific file types. You can select common file types from the list or define custom file types. Separate multiple types with a semicolon ;, for example, jpg;png.
Specific URI Applies to requests for specific URIs, excluding the http:// or https:// prefix. Separate multiple URIs with line breaks. For example, for http://www.test.com/browse/index.html, enter /browse/index.html.
Specific Directory Applies to requests under specific directories, for example, /file/abc/ for all content under http://domain/file/abc/*.
Note: Directory paths must start and end with / and can contain only letters, numbers, and certain special characters (underscore, hyphen, percent sign, and period). Separate multiple directories with line breaks.

You can further refine the rule scope by using Advanced Range Settings. These settings are combined with the basic scope using an AND relationship for more precise control. You can select one or more parameters to target specific requests or responses.

Parameter Description
User Agent (UA) Matches User-Agent strings using regex. For example, ^Mozilla/4\.0$ matches a User-Agent exactly equal to Mozilla/4.0.
Exception UA Excludes User-Agent strings using regex.
Status Code Matches specific HTTP status codes. Separate multiple codes with ;, for example, 200;404.
Exception Status Code Excludes specific HTTP status codes.
Exception File Types Excludes specific file types. Separate multiple types with ;.
Custom File Types Matches custom file types as needed. Separate multiple types with ;.
Exception Directory Excludes specific directory paths. Paths must start and end with /. Separate multiple directories with ;.
Request Method Matches HTTP request methods. Separate multiple methods with ;, for example, GET;POST.
Exception Request Method Excludes specific HTTP request methods.
Request Header Matches request headers and values. Separate the header name and value with a space. For example, Range bytes=[0-9]{9,} matches Range headers whose value starts with bytes= followed by at least 9 digits.
Exception Request Header Excludes specific request headers and values, using the same format as Request Header.
Response Header Matches response headers and values. Separate the header name and value with a space. For example, cache-control max-age= matches cache-control headers whose values contain max-age=.
Exception Response Header Excludes specific response headers and values, using the same format as Response Header.
Exception URL (Regex) Excludes URLs using regex, for example, .*\.jpg$.

Select the Operation Type

Choose one of the following operations:

  • Add: Adds a new HTTP header.
  • Replace: Replaces an existing HTTP header value.
  • Delete: Removes a specified HTTP header.

Select or Customize an HTTP Header

  • Select a common HTTP header from the provided list, such as Expires, Content-Type, Cache-Control, or Access-Control-Allow-Origin.
  • If the header you want is not in the preset list, select Custom and enter the header name manually.

Configure the HTTP Header Value

  • For the Add operation, enter the value in the New Value field.
  • For the Replace operation, configure the following:
    • New Value (required): The new value used to replace the matched header value.
    • Old Value (optional): The existing value to match before replacement. If left blank, all existing values of the header are replaced.

Note:
For Add and Replace operations, only one HTTP header can be configured per rule. For Delete operations, you can specify multiple headers.

Select the Header Control Direction

Choose the direction in which the rule should apply.

Priority

Set the rule priority. A higher number means a higher priority for matching and execution. Under the same matching conditions, rules with higher priority are executed first.

After completing the configuration, click Confirm, and then click Next Step to submit your settings. To minimize potential disruption to your production environment, we strongly recommend performing a Pre-deploy test in a staging environment. This important step ensures that your configuration is correct before it goes live.

After you confirm that the settings are correct, click Deploy Now to apply them in the live environment. The configuration typically takes effect within 3 to 5 minutes. For more information about pre-deployment testing and validation, refer to Deploy the Configurations to Staging Environment for Validation.

Important Notes

  • When adding an HTTP header, if the target request or response already contains the same header, the add operation fails and the original header is passed through unchanged. If you need to support duplicate headers, contact the Atomile technical support team.
  • If you configure Add, Replace, and Delete operations for the same HTTP header, the execution order is always Delete > Replace > Add, regardless of rule priority. Be sure to plan your rules carefully to avoid unexpected results.