HTTP: added basic URI rewrite.
This commit introduced the basic URI rewrite. It allows users to change request URI. Note the "rewrite" option ignores the contained query if any and the query from the request is preserverd.
An example:
"routes": [
{
"match": {
"uri": "/v1/test"
},
"action": {
"return": 200
}
},
{
"action": {
"rewrite": "/v1$uri",
"pass": "routes"
}
}
]
Reviewed-by: Alejandro Colomar <alx@nginx.com>
This commit is contained in:
@@ -296,6 +296,13 @@ nxt_tstr_query(nxt_task_t *task, nxt_tstr_query_t *query, nxt_tstr_t *tstr,
|
||||
}
|
||||
|
||||
|
||||
nxt_bool_t
|
||||
nxt_tstr_query_failed(nxt_tstr_query_t *query)
|
||||
{
|
||||
return query->failed;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nxt_tstr_query_resolve(nxt_task_t *task, nxt_tstr_query_t *query, void *data,
|
||||
nxt_work_handler_t ready, nxt_work_handler_t error)
|
||||
|
||||
Reference in New Issue
Block a user