tarantool / nginx_upstream_module

Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
Other
174 stars 18 forks source link

Add Nginx config option to enable setting of response status code directly from Tarantool #116

Open nordluf opened 6 years ago

nordluf commented 6 years ago

It would be a good idea to have something like tnt_status_from_response on to Nginx config, what enables the ability to return from Tarantool status code and additional headers, like that: return data[, status=200 [, headers={}]]

donbarthel commented 6 years ago

nordluf:

The documentation (on the 'Code' tab) says "Sometimes you have to set status or headers which came from Tarantool. For this purpose, you have to use something like ngx_lua or ngx_perl, etc."

But I like your suggestion better, its much less complex.

Note for others: you can change the 'content-type' header, globally, by adding this nginx.conf directive:

default_type  application/json;