diff options
author | Valentin Bartenev <vbart@nginx.com> | 2020-03-03 20:37:47 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2020-03-03 20:37:47 +0300 |
commit | a98de7f705f3b182fb405cced7ce85805bd6ffd3 (patch) | |
tree | 5fcca52bbcd8b80f5b539fb772061fea964c4cc4 /src/nxt_conf_validation.c | |
parent | a60f856ce2bc2eccbce0b0dfaa6ec98a30f74f67 (diff) | |
download | unit-a98de7f705f3b182fb405cced7ce85805bd6ffd3.tar.gz unit-a98de7f705f3b182fb405cced7ce85805bd6ffd3.tar.bz2 |
Added a "fallback" option to be used with the "share" action.
It allows proceeding to another action if a file isn't available.
An example:
{
"share": "/data/www/",
"fallback": {
"pass": "applications/php"
}
}
In the example above, an attempt is made first to serve a request with
a file from the "/data/www/" directory. If there's no such file, the
request is passed to the "php" application.
Fallback actions may be nested:
{
"share": "/data/www/",
"fallback": {
"share": "/data/cache/",
"fallback": {
"proxy": "http://127.0.0.1:9000"
}
}
}
Diffstat (limited to '')
-rw-r--r-- | src/nxt_conf_validation.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c index 4282f46b..8189cd44 100644 --- a/src/nxt_conf_validation.c +++ b/src/nxt_conf_validation.c @@ -339,6 +339,11 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_share_action_members[] = { NULL, NULL }, + { nxt_string("fallback"), + NXT_CONF_VLDT_OBJECT, + &nxt_conf_vldt_action, + NULL }, + NXT_CONF_VLDT_END }; |