Lua, memc and image_filter, image not resized via lua
agentzh at gmail.com
Sat Sep 15 06:15:32 UTC 2012
On Fri, Sep 14, 2012 at 3:22 PM, agentzh <agentzh at gmail.com> wrote:
> This is because the standard ngx_image_filter module's output filter
> always runs *after* ngx_lua's subrequest capturing filter and there's
> no easy way to change this order. The response body of your subrequest
> is captured by ngx_lua *before* the ngx_image_filter's filter gets a
> chance to run.
BTW, I've also just written a command-line utility named
ngx-body-filters that can dump out all the output body filters of any
running Nginx worker processes (on Linux) in the order they actually
This tool is part of my Nginx SystemTap Toolkit:
For example, on my side, the nginx configured with both the ngx_lua
and ngx_image_filter modules will give me the following result:
$ ./ngx-body-filters -p 30132
Tracing 30132 (.../nginx/sbin/nginx)...
113 microseconds elapsed in the probe handler.
where my nginx worker process pid is 30132.
>From this output, we can see clearly that
ngx_http_lua_capture_body_filter indeed runs before
So this tool is really handy in determining if there is an issue with
the nginx output filter running order, which is often not so obvious
for many users.
More information about the nginx