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"
}
}
}
This commit is contained in:
@@ -189,6 +189,7 @@ struct nxt_http_action_s {
|
||||
nxt_http_route_t *route;
|
||||
nxt_http_upstream_t *upstream;
|
||||
nxt_app_t *application;
|
||||
nxt_http_action_t *fallback;
|
||||
} u;
|
||||
|
||||
nxt_str_t name;
|
||||
|
||||
Reference in New Issue
Block a user