mod_errors replaces error responses by specified rules.
conf/mod_errors/mod_errors.conf
Config Item | Description |
---|---|
Basic.DataPath | String Path fo rule configuration |
Log.OpenDebug | Boolean Whether enable debug logs Default False |
[basic]
DataPath = mod_errors/errors_rule.data
Config Item | Description |
---|---|
Version | String Version of config file |
Config | Object Error rules for each product |
Config{k} | String Product name |
Config{v} | Object A list of error rules |
Config{v}[] | Object A error rule |
Config{v}[].Cond | String Condition expressio, See Condition |
Config{v}[].Actions | Object Action |
Config{v}[].Actions.Cmd | String Name of Action |
Config{v}[].Actions.Params | Object Parameters of Action |
Config{v}[].Actions.Params[] | String A Parameter |
Action | Description |
---|---|
RETURN | Return response generated from specified static html |
REDIRECT | Redirect to specified location |
{
"Version": "20190101000000",
"Config": {
"example_product": [
{
"Cond": "res_code_in(\"404\")",
"Actions": [
{
"Cmd": "RETURN",
"Params": [
"200", "text/html", "../conf/mod_errors/404.html"
]
}
]
},
{
"Cond": "res_code_in(\"500\")",
"Actions": [
{
"Cmd": "REDIRECT",
"Params": [
"http://example.org/error.html"
]
}
]
}
]
}
}