All Products
Search
Document Center

Edge Security Acceleration:Configure 301/302 origin follow redirects

Last Updated:Jun 17, 2026

When the origin returns a 301 or 302 redirect, ESA POPs follow the redirect to fetch the target resource directly, reducing round trips and accelerating delivery.

Prerequisites

Your origin server uses 301 or 302 redirects.

About 301 and 302 redirects

HTTP 301 indicates a permanent redirect and HTTP 302 indicates a temporary redirect. Both include a Location header that points to the new resource URL. The client follows this header to access the resource at the new address.

How 301/302 redirect works

When an ESA POP receives a 301 or 302 response from the origin, it follows the Location header to fetch the resource directly instead of returning the redirect to the user.

Process flow:

image

  1. A user requests http://example.com/examplefile.txt from an ESA POP.

  2. The file is not cached on the ESA POP, so the POP requests it from the origin.

  3. The origin returns a 301 or 302 response to the ESA POP with the Location header pointing to http://www.example.org/examplefile.txt.

  4. The ESA POP follows the Location header and requests http://www.example.org/examplefile.txt.

  5. The ESA POP retrieves and caches the resource.

  6. The ESA POP serves the resource to the user.

Subsequent requests for http://example.com/examplefile.txt hit the cache on the ESA POP and are served directly.

Supported header formats

  • The Location header in the 301 or 302 response from the origin to the ESA POP supports these formats:

    • Standard domain name format: http://www.example.net/index.html

    • IPv4 address format: http://10.10.10.10/index.html

  • The Host header remains unchanged during a redirect follow request regardless of whether original request headers are retained.

Set up redirect rules

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

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

  3. Click Create Rule and enter a Rule Name.

  4. Under If requests match..., set the match conditions for incoming requests. To learn more about creating a rule expression, see Composition of a rule expression.

  5. In the 301/302 Redirect Follow section, click Configure beside the feature. Turn on Status, and then configure the following parameters for 301/302 origin follow redirects:

    • Maximum Redirects: Maximum times an ESA POP follows Location headers per request.

      If exceeded, the 301/302 response is returned to the user. Valid values: 1 to 5. Default: 2.

      Note

      This setting also limits total origin access per request.

      Origin access limit = maximum redirects + 1.

      Default: 3. Valid values: 2 to 6.

    • Original Request Parameters: Whether to retain the original request parameters when following the redirect to the origin.

    • Original Request Header: Whether to retain the original request headers when following the redirect to the origin.

    • Target Host: Controls the Host header value when the ESA POP follows a redirect. Rules:

      • If a domain is configured here, it overrides the Host header regardless of the Location header format.

      • If the Location header contains a domain name, the Host header value is the same as that domain name.

      • If the Location header contains an IP address, the Host header value from the original request is preserved.

  1. Click OK.

Related documentation

Rule-related features vary in effective priority, reentrancy, and effective granularity. For details, see Properties of Rule-Related Features.