Hello!
On Mon, Mar 10, 2014 at 11:33 PM, Mathew Heard wrote:
> How is the lua modules position in the body filter chain determined?
>
Just as any other nginx filter modules, the order of filter modules is
determined by the *reversed* order of their corresponding
--add-module=PATH option for ./configure while building nginx.
In ngx_openresty bundle, ngx_lua is added *after* ngx_srcache, which
means ngx_lua's filters always run *before* ngx_srcache.
You can always find out the --add-module=PATH option order in an
existing nginx build by checking out the output of the "nginx -V"
command.
You can also find out the actual running order of all the filters
(including builtin ones) by means of the ngx-body-filters tool based
on systemtap:
https://github.com/agentzh/nginx-systemtap-toolkit#ngx-body-filters
> I find myself in need to perform actions before and after srcache and would
> prefer not to add a further layer of subrequests for a small possible
> modification.
You'd better avoid using an output filter twice along a single output
filter chain. nginx does not support that at all.
Regards,
-agentzh