-
Notifications
You must be signed in to change notification settings - Fork 19
Add abbility to change HTTP reply code from LUA procedure. #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This feature does not exist. Basically it is hard to implement due to Tarantool binary protocol limitations and nginx upstream phases synchronisation. So I thought about this feature a lot and I have the only one idea. if I share it with you can you implement it? :) P.S. This feature does not have high priority at the moment. |
Will do my best! |
The first part is Before we go any further you have to read this one: Tarantool iproto: https://tarantool.org/doc/dev_guide/internals_index.html So there are have few problems:
Possible implementation is: How could it be fixed? Well. All problems could be solved by re-implement nginx socket handlers (i.e. write/read to upstream write/read from upstream). - nginx gives such feature. In detail it will be like - The new Nginx write handler should wait all body at the header phase. After it happened (means all body recived) parser should try to find information about status and headers in body and if it found (means status and header) it should send status and headers to the client. Or you can hack nginx's phases. |
…l 1.6.x, it starts from this commit. Update tests & add some new
This version is support this feature, a link https://github.com/tarantool/nginx_upstream_module/releases/tag/v2.4.0-beta For details see https://github.com/tarantool/nginx_upstream_module#tnt_eval |
It would be quite nice to have abbility to send arbitrary HTTP reply code from within called LUA procedure.
In particular, it will make possible to utilize http://nginx.org/en/docs/http/ngx_http_auth_request_module.html for access control, based on result of LUA function invocation.
AFAICS, we could control only reply body so far.
If this feature already available, would be good to see example in readme.
The text was updated successfully, but these errors were encountered: