Hello!
On Tue, Jan 14, 2014 at 6:53 AM, fasihullah.askiri wrote:
> My module also
> handles rewrite and I was hoping it would be invoked after the lua module
> (wanted to use some variables set in rewrite_by_lua). However, lua module
> seems to be forcing itself to be the last in ngx_http_lua_rewrite_handler.
Well, you can disable this behavior by putting the following line into
your nginx.conf:
rewrite_by_lua_no_postpone on;
See https://github.com/chaoslawful/lua-nginx-module#rewrite_by_lua_no_postpone
> Could someone please explain why is it necessary for the lua to be the very
> last module?
>
Because it's usually desired to let rewrite_by_lua run after the
standard ngx_rewrite module when Nginx variables are used in Lua.
Regards,
-agentzh