tarantool / nginx_upstream_module

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

Feature request: Command for adding arbitrary headers #51

Closed mngmntt closed 7 years ago

mngmntt commented 8 years ago

Hello,

It would be nice to have a possibility to add a header before passing request to tnt. I don't think it should work any different from proxy_set_header or fastcgi_param.

For example:

tnt_pass_http_request on;
tnt_set_header X-GEO-COUNTRY $geoip_country_code;

This should add X-GEO-COUNTRY value to req.headers table.

dedok commented 8 years ago

@irqed Hi. Do you need this feature ASAP? Or I can schedule to the next release

Totktonada commented 7 years ago

I would use proxy_set_headers to pass client IP to a tarantool instance, like so:

proxy_set_header X-Real-IP $remote_addr;

UPD: now I use rewrite_by_lua, so maybe more convenient way to me would be use ngx.req.set_header.

dedok commented 7 years ago

in 1f057360b6a2425e31bd15fe890397e49687d748