Hello!
On Thu, Sep 17, 2015 at 7:52 PM, Mathew Heard wrote:
> I know the order of directives in lua depend on the order of configure
> directives, specifically the "--add-module" options.
>
Yes.
> Does this extend to built in modules?
Usually we cannot tweak the loading order of builtin modules since
there is no --add-module=PATH options for such modules.
You can always check out the objs/ngx_modules.c file for the actual
order determined at compile time.
> Looking at the configuration template
> these appear to be in a pre-set order at-least to some degree.
>
> # the filter order is important
> # ngx_http_write_filter
> # ngx_http_header_filter
Well, for nginx output filter modules, the running order is the
reverse of the loading order. This is due to how output filters are
registered (similar to a stack). This does not apply to most of the
request phase handler modules though.
>
> If so does content_by_lua (and similar) run before or after proxy_pass &
> proxy_cache?
>
Well, content_by_lua registers a content handler while proxy_pass
registers a content handler too. Because a single location can only
have a single content handler, if you configure both content_by_lua
and proxy_pass there, only one will win (and the other one is simply
overwritten).
Regards,
-agentzh