fail_action
Version: v2025-01-13 | Includes use: Yes |
---|
Behavior name: Site Failover
Specifies how to respond when the origin is not available: by serving stale content, by serving an error page, or by redirecting. To apply this behavior, you should match on an origin_timeout
or match_response_code
.
Default behavior
These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.
data "akamai_property_rules_builder" "fail_action" {
rules_v2025_02_18 {
name = "Site Failover"
comments = "Specifies how to respond when the origin is not available"
behavior {
fail_action {
enabled = true
action_type = "REDIRECT"
redirect_hostname_type = "ALTERNATE"
redirectHostname = ""
redirect_custom_path = true
redirect_path = ""
redirect_method = 302
preserve_query_string = true
modify_protocol = false
}
}
}
}
"behaviors": [
{
"name": "failAction",
"options": {
"enabled": true,
"actionType": "REDIRECT",
"redirectHostnameType": "ALTERNATE",
"redirectHostname": "",
"redirectCustomPath": true,
"redirectPath": "",
"redirectMethod": 302,
"preserveQueryString": true,
"modifyProtocol": false
}
}
]
Options
Option | Description |
---|---|
enabled |
When enabled in case of a failure to contact the origin, the current behavior applies.
|
action_type |
Specifies the basic action to take when there is a failure to contact the origin. Value is one of:
|
saas_type |
Identifies the component of the request that identifies the SaaS dynamic fail action. Value is one of:
|
saas_cname_enabled |
Specifies whether to use a CNAME chain to determine the hostname for the SaaS dynamic fail action.
|
saas_cname_level |
Specifies the number of elements in the CNAME chain backwards from the edge hostname that determines the hostname for the SaaS dynamic fail action.
|
saas_cookie |
Specifies whether to use a CNAME chain to determine the hostname for the SaaS dynamic fail action.
|
saas_query_string |
Specifies the name of the query parameter that identifies this SaaS dynamic fail action.
|
saas_regex |
Specifies the substitution pattern (a Perl-compatible regular expression) that defines the SaaS dynamic fail action.
|
saas_replace |
Specifies the replacement pattern that defines the SaaS dynamic fail action.
|
saas_suffix |
Specifies the static portion of the SaaS dynamic fail action.
|
dynamic_method |
Specifies the redirect method. Value is one of:
|
dynamic_custom_path |
Allows you to modify the original requested path.
|
dynamic_path |
Specifies the new path.
|
redirect_hostname_type |
Whether to preserve or customize the hostname. Value is one of:
|
redirect_hostname |
When the
action_type is REDIRECT and the redirect_hostname_type is ALTERNATE this specifies the hostname for the redirect.
|
redirect_custom_path |
Uses the
redirect_path to customize a new path.
|
redirect_path |
Specifies a new path.
|
redirect_method |
Specifies the HTTP response code. Value is one of:
|
content_hostname |
Specifies the static hostname for the alternate redirect.
|
content_custom_path |
Specifies a custom redirect path.
|
content_path |
Specifies a custom redirect path.
|
net_storage_hostname |
When the
action_type is RECREATED_NS specifies the NetStorage origin to serve the alternate content. Contact Akamai Professional Services for your NetStorage origin's id . Contains:
|
net_storage_path |
|
cex_hostname |
Specifies a hostname.
|
cex_custom_path |
Specifies a custom path.
|
cex_path |
Specifies a custom path.
|
cp_code |
Specifies a CP code for which to log errors for the NetStorage location. Contains a CP code id without the prefix.
|
status_code |
Assigns a new HTTP status code to the failure response. Value is one of:
|
preserve_query_string |
When using either
content_custom_path , cex_custom_path , dynamic_custom_path , or redirect_custom_path to specify a custom path, enabling this passes in the original request's query string as part of the path.
|
modify_protocol |
Modifies the redirect's protocol using the value of the
protocol field.
|
protocol |
When the
action_type is REDIRECT and modify_protocol is enabled, this specifies the redirect's protocol. Value is one of:
|
Updated about 1 hour ago