Hello!
On Tue, May 22, 2012 at 10:19 PM, Tzury Bar Yochay <tz...@reblaze.com> wrote:
> I want to elaborate a bit about our needs, see if current version supports
> it, and if not, hiring you to make the patch ;-)
> So far we have been using the Lua plugin to work with the user posted data,
> now we wanted to move on, handling data
> sent by proxified server (back-end server) and ran into some
> issues/questions
>
> I want to inspect and perhaps modify the content that comes from the server
> before sending it to the client
> that content might be HTML, JavaScript or CSS files, or perhaps even binary
> (images, videos, etc.) but we can focus on the text/* at the moment
> This should also take into account situations where the back server
> compresses the content.
>
> As I said previously, I would rather let proxy module fetch the request from
> the back-end server and get a hooking point, rather than utilizing
> location.capture.
>
Ideally, this should be done via Lua code running in the nginx output
filter, i.e., the body_filter_by_lua or body_filter_by_lua_file
directives. But you'll lose the ability to call those ngx_lua APIs
that require network I/O (like ngx.location.capture and
ngx.socket.tcp) from within the Lua code in this very context.
The body_filter_by_lua and body_filter_by_lua_file are on our TODO list.
> In a nutshell, what I'd like to know is what is the minimum nginx.conf and
> corresponding minimal lua files that will enable nginx to act as a proxy,
> while keeping the extent possible the nginx default performance and enabling
> the feature above.
>
>
> best regards,
> Tzury
>
> PS, regarding cookies and browser issue mentioned here:
> http://forum.nginx.org/read.php?2,204971,210374
>
> is your answer in that page still relevant?
>
I think so :) The header_filter_by_lua and header_filter_by_lua_file
are already implemented (by liseen) but not those body filter hooks.
Regards,
-agentzh