All Products
Search
Document Center

Edge Security Acceleration:Customize the origin Host

Last Updated:Dec 08, 2025

When Edge Security Acceleration (ESA) requests resources from an origin server, the default Host request header is determined by the origin server type. When needed, you can modify the origin Host request header to ensure that requests are correctly routed to the origin server.

Important
  • Your origin server must support matching different virtual sites using the Host request header. Otherwise, this feature does not work as expected.

  • An origin Host parameter set in an origin rule has a higher priority than one set in Manage DNS Records. If the parameter is configured in both locations, the value from the origin rule is used.

Related concepts

Default ESA origin Host

The Host request header specifies the domain name of the requested server. When an ESA point of presence (POP) requests resources from an origin server, the default Host is determined by the following rules:

  • If the Record Value is an IPv4 address, IPv6 address, domain name, Server Load Balancer, or origin pool: The default setting for Origin Host is Match Requested Domain Name. This means the Host from the client request is used as the origin Host.

  • If the Record Value is OSS/S3 Compatible: The default setting for Origin Host is Match Origin's Domain Name. This means the domain name of the origin server is used as the origin Host.

The origin server uses the Host field in the origin request to return resources for the corresponding site, such as www.example.com. If you have multiple sites configured on your origin server (for example, in a virtual hosting scenario), the origin server validates the Host field to return the correct resources.

Virtual hosting

Virtual hosting is a technique that allows a single web server to host multiple websites. The server uses different domain names or hostnames to distinguish between the websites. When a client requests a specific domain name or hostname, the server directs the request to the corresponding virtual site to deliver the correct content.

Create an origin Host rule

  1. In the ESA console, select Websites, and then click the target site in the Website column.

  2. In the navigation pane on the left, choose Rules > Origin Rules.image

  3. Click Create Rule and enter a Rule Name.

  4. In the If requests match... section, configure the conditions for the request. For more information about how to configure rules, see Components of a rule expression.

  5. In the Origin Host section, click Configure. Specify the origin Host and click OK.

    image

Example: Configure virtual sites

This example shows how to configure virtual sites using Nginx. In the Nginx configuration file, you can set up multiple virtual sites in the server blocks, such as www.example.org, www.example.net, and www.example.com.

server {
    listen      80;
    server_name example.org www.example.org;
    ...
}

server {
    listen      80;
    server_name example.net www.example.net;
    ...
}

server {
    listen      80;
    server_name example.com www.example.com;
    ...
}

Nginx first checks the Host field in the HTTP request header to determine which virtual site to route the request to. If no match is found, Nginx uses the default virtual site. If no default site is configured, the first server block is used as the default. To correctly route each request to its corresponding virtual site, follow these steps:

image
  1. In the ESA console, select Websites, and then click the target site in the Website column.

  2. In the navigation pane on the left, choose Rules > Origin Rules. On the Origin Rules page, click Create Rule.

  3. On the configuration page, configure the parameters and click OK:

    • Rule Name: Enter a name for the rule, such as rule-virtual-com.

    • If requests match...: Configure the rule conditions. For example, select Full URI and starts with, and then enter http://www.example.com.

    • Then execute...: In the Origin Host section, click Configure and enter the corresponding virtual site address, such as www.example.com.

      image

  4. Repeat the previous step to create two more rules: rule-virtual-org and rule-virtual-net.

    image

    image

References

Rule-related features vary in execution priorityrule behavior, and configuration scope. For more information, see How ESA rules take effect.