This topic answers common questions about rules.
Identify private CIDR block
Some Internet Service Providers (ISPs) in specific regions may assign private IP addresses to clients. As a result, an ESA node might receive a client IP from a private CIDR block. This prevents rules that use parameters like country/region, province, and carrier from accurately identifying these requests. To handle requests from private CIDR blocks, follow the steps below.
Step 1: Create an IP list
Go to Global Settings > Lists. Click Create List and add the following three private IP Address/CIDR Block entries:
Class A private IP address: 10.0.0.0 to 10.255.255.255, subnet mask: 10.0.0.0/8.
Class B private IP address: 172.16.0.0 to 172.31.255.255, subnet mask: 172.16.0.0/12.
Class C private IP address: 192.168.0.0 to 192.168.255.255, subnet mask: 192.168.0.0/16.
After you add the entries, the configuration appears as shown in the following figure. Click OK.
Step 2: Add private CIDR block rule
This example uses a custom rule. On the WAF Custom Rules page, for logical expression, select is in list, and then select the newly created group from the drop-down list, click Create Rule .
After you finish, click OK.
After you add these rule conditions, ESA accurately identifies client requests from private CIDR blocks.
Mini-program image loading failure
Symptoms
After you configure a rate-based rule in ESA (for example, trigger a JS/slider challenge for 1 hour if more than 20 requests are received in 10 seconds), all images in a mini-program fail to load. Deleting the rule resolves the issue.
Cause
When a mini-program loads, it sends many concurrent requests for images. This burst of requests can easily exceed the configured frequency threshold. When the rate-based rule is triggered, it intercepts legitimate image requests and presents a JS/slider challenge. The mini-program environment cannot execute this challenge, which causes all image requests to be blocked.
Solution
To resolve this issue, use one or more of the following methods:
Increase the frequency threshold: Set a higher threshold (for example, 100 requests per 10 seconds) to prevent the rule from being triggered during normal image loading.
Narrow the match scope: In the rule's match condition, exclude image requests by filtering based on URL path or file extension. This ensures the rate-based rule applies only to non-static resource requests.
Configure a whitelist: Add the mini-program's known source IPs or Referer to a whitelist to exempt them from the rate-based rule.
Temporarily delete the rule: If you cannot immediately determine a suitable threshold, first delete the rate-based rule to restore service. Then, use the request analysis feature in the ESA console to identify abnormal IP addresses and configure a more precise rule.
What challenge types are available for high-threat requests?
When a request is identified as a potential threat, the system issues a challenge:
JavaScript challenge: Injects JavaScript to verify the client is a real browser. Transparent to most users but may affect API clients that do not support JavaScript.
CAPTCHA: Requires an interactive task (puzzle or slider) to prove the user is human. Interrupts the access flow.
What is the difference between security rules and WAF rules?
Security levels and WAF rules are independent features. Security levels automatically block or challenge requests based on threat intelligence. WAF rules are custom rules you define to match specific paths, parameters, or behaviors for more granular control.
Why does my bypass cache rule not take effect?
Check the following:
Incorrect match condition: Verify the rule expression. Common mistakes include:
An OR condition unintentionally matches requests from other domains.
File name extension or path values are formatted incorrectly. For example,
.phpinstead ofphp.
Missing request characteristics: If the rule depends on a specific request header (such as
sec-fetch-site), confirm that actual client requests include this header.Insufficient rule priority: ESA evaluates rules from top to bottom. If the bypass cache rule is positioned below a long-TTL caching rule, the earlier rule may match first. Move the bypass cache rule to a higher position in the list.
Cache not flushed after rule change: After modifying rules, flush affected URLs or directories in the ESA console. Refreshing your browser does not invalidate content cached at edge nodes.
Verification approach: Check the
Serverresponse header to confirm whether requests are being processed by ESA edge nodes. Use an incognito browser window to eliminate local browser cache interference.
Why can't I log in, or why do pages redirect incorrectly after enabling ESA?
Cause: This typically occurs when a full-site cache rule or an improperly configured cache rule causes login cookies, session data, or dynamic API responses to be cached at ESA edge nodes.
Resolution:
Suspend or delete any suspicious full-site cache rules.
Create Bypass Cache rules specifically for login pages, CAPTCHA endpoints, and admin paths. Position these rules at the top of the rule list to give them the highest priority.
In the ESA console, flush the cache for the affected URLs.
Verify the fix using an incognito browser window.
If the issue persists after configuration is correct: Check your origin server business logic. For example, verify that 302 redirect logic correctly identifies the login state. If the origin server is not correctly handling login state, this is outside the scope of ESA.
What is the difference between "equals" and "contains" in match conditions?
Match type | Behavior |
Equals | Exact match of the specified URL path. Also automatically matches all sub-paths. For example, configuring |
Contains | Fuzzy match. Any URL that includes the specified string anywhere is matched. |
For hostname matching, both Equals and Contains produce equivalent results and can be used interchangeably.
Why does enabling cache rules make probing succeed, but disabling them causes timeouts?
When cache rules are active, ESA edge nodes serve requests directly from cache, reducing load on the origin server.
When cache rules are disabled, all requests — including high-volume dynamic requests — go directly to the origin server in real time. Under high-concurrency load testing, this can overwhelm the origin server and cause request timeouts.
This behavior reflects an origin server performance bottleneck, not an ESA issue. To address this:
Configure cache rules to reduce the volume of requests forwarded to origin.
Enable JS Challenge or Intelligent Rate Limiting to protect the origin server from excessive concurrent requests.
Why isn't stale content served after deleting an origin file?
The Serve Stale Content feature is triggered only when the origin server returns a 4xx or 5xx HTTP status code, or when the request times out. If you only delete a file from your origin server but the server itself continues to respond normally (for example, by returning a default page with a 200 status code, or by returning a 404 status code), this is not considered an origin fetch failure and will not trigger Serve Stale Content.
If you need to access a file from the cache after it has been deleted from the origin server, confirm the following:
The origin server must be unreachable (for example, the server has crashed, there is a network interruption, or it returns a 5xx error code), not merely that a single file was deleted.
A copy of the file was already cached on the edge node before it was deleted. If the file was never cached, or if the cache was purged, there is no stale content to serve, even if the feature is triggered.
Why are requests still being sent to the origin server after configuration?
The cache has expired: Check whether the configured
TTLvalue is too short. Examine response headers such asCache-Controlto confirm the cache TTL.Different URL parameters: By default, different
URLparameters are treated as different cache keys. Configure cache key rules to ignore irrelevant parameters.The rule has not taken effect: Verify the rule’s matching conditions, such as the path pattern, to ensure they cover the target request.
How do I verify the cache status of a specific URL?
Use the curl command to view the detailed response headers:
curl -v -I https://example.com/target-urlx-site-cache-status: HIT : The cache status of the requested resource on the ESA POP.
How do I manually purge the cache for a specific status code?
When do I need to adjust the body size limit?
The body size limit determines which POST requests are eligible for caching. Requests that exceed this limit are forwarded directly to the origin server without being cached. Consider the following when setting the limit:
Increase the limit (for example, to 6 KB–8 KB): If your POST requests have complex or large request bodies, such as search queries with nested structures or aggregation queries with multi-dimensional filter parameters, a higher limit is necessary. This ensures these requests are cached, maximizing performance benefits.
Use a smaller limit (for example, 1 KB–2 KB): If your POST requests contain only simple parameters or a few identifiers, such as a user ID or a timestamp, a large limit is unnecessary.
How do I verify that origin configuration changes have taken effect and troubleshoot origin function issues?
Verify origin IP or configuration changes
After updating the origin configuration, access your website and verify that the returned content is from the new origin server. You can also check the access logs on the origin server to confirm that requests are arriving from ESA nodes.
Troubleshoot origin feature failures (for example, language switching)
If a site feature (such as language switching) stops working after enabling ESA, follow these steps:
Add a local hosts entry that maps the origin server IP address to the test domain. Access the site through this direct connection, bypassing ESA, to determine whether the issue originates from the origin server itself.
Clear the browser cache and retry.
Do error code redirect rules apply to origin errors or edge node errors?
The rule applies only to error codes returned by the origin server.
What happens if multiple rules match the same request?
Rules are evaluated from top to bottom. The first matching rule is applied and evaluation stops. Place more specific rules above general ones.
Do error code redirect rules and request redirect rules share the same quota?
Yes. The two rule types share the same redirect rule quota. The count shown on the Redirect Rules page reflects the combined total of both rule types.
How do I redirect between a root domain (bare domain) and a www domain?
The approach depends on your DNS configuration:
Using ESA for redirect: Both the root domain and the www domain must be connected to ESA via CNAME or NS records. Even if you configure a redirect rule, the source domain must retain its CNAME record so ESA can recognize incoming traffic. After both domains are connected to ESA, configure the corresponding hostname redirect rule in the ESA redirect rules.
Root domain has MX records and cannot be CNAMEd (DNS conflict): Use the URL forwarding feature provided by your DNS provider. Note that DNS URL forwarding only supports HTTP and traffic does not pass through ESA.
Important: If you previously configured a URL forwarding record in your DNS settings, you must delete that record and add the ESA CNAME before using ESA redirect rules. Otherwise, ESA redirect rules will not take effect.
What should I do if a redirect rule does not take effect or redirects to the wrong URL?
Check the following items in order:
Verify the match condition covers the target domain precisely: For example, if you only configured a rule for the www domain but users access the root domain, add a root domain rule or use a wildcard to cover both.
Confirm that DNS is correctly connected to ESA: If you are using ESA redirect, the domain must be connected to ESA via CNAME or NS records. Relying solely on the origin server's redirect configuration or DNS URL forwarding will not work.
Check for higher-priority rules overriding the redirect rule: Review the rule priority order and ensure no upstream rule is intercepting or modifying the request before the redirect rule is evaluated.
Verify dynamic expression syntax: URL concatenation requires the
concatfunction. Entering a raw string with variables will fail. Use valid expression functions such asconcat,regex_replace, orwildcard_replace.
What should I do if redirects cause an infinite loop or make the website inaccessible?
Try the following troubleshooting steps:
Check for a circular redirect configuration: Verify whether the www domain's origin server points to the root domain while you have also configured a root-to-www redirect, creating a loop. Restore the origin to the actual IP address or the original upstream origin address.
HTTP-to-HTTPS redirect: Use the Force HTTPS feature in the ESA console rather than manually configuring redirect rules. Manual rules can conflict with each other and create redirect loops.
Clear the redirect cache: If a stale redirect response persists due to caching, purge the cache in the ESA console and then re-test the redirect behavior.
Check for mismatched rules: Confirm that redirect rules do not inadvertently match health check endpoints or special internal paths, which could cause access failures.
How do I configure conditional redirects based on device type (such as mobile) or request characteristics?
You can use request headers such as User-Agent in the incoming request match conditions:
Matching method: Use Contains rather than Equals for User-Agent matching, because User-Agent strings are typically long and vary across devices.
Mobile redirect example: Set the match condition to
User-Agent Contains Mobileor use keywords such asAndroidoriPhone, then configure the action as a 302 redirect to the mobile domain.Advanced control: Combine path, query parameters, and other conditions for granular redirect control. For example, redirect mobile users accessing
/tom.example.com, while desktop users continue to the standard domain.
Why does the browser URL not change after I configure a redirect rule?
If the browser URL does not change, you may be using URL rewrite instead of request redirect:
ESA request redirect sends a 3xx response to the client, which causes the browser to navigate to the new URL and update the address bar.
URL rewrite only modifies the origin request path transparently (server-side proxy) and does not change the browser URL. If you need to keep the browser URL unchanged while modifying the path sent to the origin, use the URL Rewrite feature instead of redirect rules.
Note on acceleration region: If the acceleration region does not include the Chinese mainland, users in the Chinese mainland may not experience acceleration when accessing the redirect target.