These steps describe how to detect an EdgeWorkers failure using the
EdgeWorkers Execution Status in the match condition of a Rule. You can then define
which Failover action to take when this rule detects a failure.
In this use case the EdgeWorkers logic
exists at the origin and the EdgeWorker is being used to eliminate requests to this logic at
the origin. If an EdgeWorkers error occurs we want to forward the request to an alternate
location to execute the origin logic.
How to
-
Create a Rule with a match condition
that checks the EdgeWorkers Execution Status.
Note: To serve a 500 level error to the customer do not add the Site Failover behavior.
The EdgeWorker error is propagated to the end user, allowing the client to handle the
failure.
-
To Redirect to a different location add
the Site Failover behavior to the rule. This logic is only executed if an EdgeWorker
function fails for any reason.
-
Click Add Behavior to add the Failover
behavior to the rule.
-
Select Redirect to a different location from
the Action dropdown. For more
information about how to configure this Failover behavior see the Site Failover Property Manager behavior documentation.