Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
The version has a new option pass_subrequest_uri
for tnt_pass_http_request
config directive.
Previous implementation unconditionally passes unparsed uri, recieved from client. However it can be changed due to several internal redirects, such as rewrite
, X-Accel-Redirect
, etc. If the new option for tnt_pass_http_request
is set, the actual subrequest uri will be passed to tarantool upstream.
Default behaviour coincides with the old one for saving backward compatibility.
You can find more information and examples into the README
The version has a new features, it called 'format' or tarantool protocol over REST.
Tarantool stores data in tuples. A tuple is a list of elements. Each element is a value or an object, and each element should have a strong type. The tuple format is called MsgPack, it's like JSON in a binary format.
The main goal of Format (see [FMT] above) is to enable conversion between
a query string and MsgPack without losing type information or value.
The syntax is: {QUERY_ARG_NAME}=%{FMT_TYPE}
Please look carefully for yours url encoding!
You can find more information into the README.md.
A related issue: https://github.com/tarantool/nginx_upstream_module/issues/66
https://github.com/tarantool/nginx_upstream_module/issues/98 https://github.com/tarantool/nginx_upstream_module/issues/105 https://github.com/tarantool/nginx_upstream_module/issues/108
syntax: tnt_multireturn_skip_count [0|1|2]
default: 0
context: http, server, location
Module will skip one or more multireturn parts when this option is > 0 When it is set to 0
location ~ /api/([-_a-zA-Z0-9/]+)/ {
tnt_method $1;
tnt_pass backend:3113;
}
tnt_pass_http_request has a new option, it's parse_urlencoded. This option make nginx parse incoming x-www-urlencoded data into the Lua table. Here is details: https://github.com/tarantool/nginx_upstream_module#tnt_pass_http_request
tnt_set_header, it's a new option. it allows redefining or appending fields to the request header passed to the tarantool proxied server. The value can contain text, variables, and their combinations.
syntax: tnt_multireturn_skip_count [0|1|2]
default: 0
context: http, server, location
Module will skip one or more multireturn parts when this option is > 0 When it is set to 0
location ~ /api/([-_a-zA-Z0-9/]+)/ {
tnt_method $1;
tnt_pass backend:3113;
}
tnt_pass_http_request has a new option, it's parse_urlencoded. This option make nginx parse incoming x-www-urlencoded data into the Lua table. Here is details: https://github.com/tarantool/nginx_upstream_module#tnt_pass_http_request
tnt_set_header, it's a new option. it allows redefining or appending fields to the request header passed to the tarantool proxied server. The value can contain text, variables, and their combinations.
tnt_eval
tnt_pass
Module reply has been changed. Now it does not returns 'result', it returns a raw result only.
Module does not support experemental flags tnt_pure_result and tnt_multireturn_skip_count.
Module does not support tarantool 1.6.*; it supports only 1.7.+.