Hello!
On Wed, Jul 13, 2016 at 12:41 AM, Jose Diaz-Gonzalez wrote:
>
> What I'd like to do is to be able to duplicate the
> `init_worker_by_lua_block` section in each included nginx config as we'll be
> using consul-template to template out those files for services upon which we
> depend. From what I can tell, this isn't possible. Is there a way around
> this limitation, perhaps by requiring all lua files within a directory (the
> directory scan might be blocking) or something else? In theory we could
> template out a separate set of `init_worker_by_lua` files out separately and
> concatenate them/reload nginx every time they are generated, though that
> seems like a lot of extra work.
Do combinations on the Lua level, instead of on the nginx.conf level,
which is way more flexible and also much more efficient.
Just use multiple Lua modules or even dynamically loaded Lua code from
remote services (like redis or memcached) in a single
init_worker_by_lua* handler.
Regards,
-agentzh