Important note

The EdgeRules feature is available only on Enterprise plans.

The following example shows how to handle the request Host header and alter it based on the value in the local Nginx variable $scheme. The idea is to use “domain-one.com” in the Host header for requests coming in via the http and “domain-two” for https.

Nginx configuration block

location / {
        if ($scheme = http) {                                  
            set $request_host "domain-one.com";
        }
        if ($scheme = https) {                                  
            set $request_host "domain-two.com";
        }
        proxy_set_header Host $request_host;
Note: If Origin Shield is enabled on your zone, you may see following line: proxy_set_header Host $request_host. Don’t be alarmed though. This directive is ignored on the edge server and applied on the Origin Shield configuration instead.