Hi, You can cover all those stages in Lua. As for response body, check for ngx.arg[1] https://github.com/openresty/lua-nginx-module#body_filter_by_lua (it's available in certain stages only, but you can hack around that and pass it using ngx.ctx) https://stackoverflow.com/a/54432177/2388324
On Wed, Dec 30, 2020 at 3:58 PM Federico Felman <f...@hotmail.com> wrote: > Hello Andrei, > > Thanks for writing back. > > I wanted to take enough time check all the links. > > I’ve read about OpenResty but my concern is how to access the data I need. > > So basically I’m diving my process in stages. > > Stage 0: research and get the correct approach (this current stage) > > Stage 1: get all the request and response to go through a custom functions > (processReq, processResp). > > Stage 2: write those functions to call the appropriate APIs. > > Stage 3: stress test and optimization. > > I think OpenResty solves the Stage 2 but I still don’t know how to handle > properly the REQ/RESP, mostly the response since the REQ could be the first > module called. But I couldn’t find anything clear on catching the response. > > Maybe this is pretty straight forward but I’m messing this up. > > > > Thanks you everyone for reading this. > > > > > > *From: *Andrei <lag...@gmail.com> > *Sent: *Tuesday, December 29, 2020 4:24 PM > *To: *nginx@nginx.org > *Subject: *Re: Getting started with a Module > > > > Happy Holidays! > > > > You mean something like this? > > > https://serverfault.com/questions/361556/is-it-possible-to-log-the-response-data-in-nginx-access-log > > > > Either way, you're probably looking at OpenResty Lua ( > https://github.com/openresty/lua-nginx-module), cosockets ( > https://github.com/openresty/lua-nginx-module#cosockets-not-available-everywhere), > and maybe mlcache (https://github.com/thibaultcha/lua-resty-mlcache). > Instead of writing a full blown module, consider using Lua. I know this > isn't an OpenResty forum, but... https://opm.openresty.org/ also has a > bunch of goodies that might help :) > > > > gl! > > > > On Tue, Dec 29, 2020 at 4:16 PM Federico Felman <f...@hotmail.com> wrote: > > Hello everyone and happy holidays. > > I’ve been asked to do a specific module for NGINX, I need to “log” all the > requests and responses using some specific web services. > > For what I’ve seen I can read the REQ easily but I don’t see any way to > access the response. > > Can you guys help me? > > > > Thanks in advance!!! > > > > > > _______________________________________________ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx