Hello!
On Thu, Jul 30, 2015 at 8:44 PM, Andre R wrote:
> are multiple access_by_lua directives possible?
Nope. You should combine your logic in Lua instead. See the following
FAQ for more details:
http://openresty.org/faq.html#why-cant-i-use-duplicate-configuration-directives
> In connection with "satisfy
> any" this would give me an "or" logically. Currently I'm getting an
> emergency error from nginx telling me that it access_by_lua is duplicate.
>
Yeah, you're told that you're doing something not allowed :)
> However, there is this note:
> http://mailman.nginx.org/pipermail/nginx/2012-March/032811.html
> "bugfix:
> access_by_lua<http://wiki.nginx.org/HttpLuaModule#access_by_lua>could not
> work with the satisfy any configuration."
This is only for combining access_by_lua with other access-phase
directives from other nginx C modules.
> Which makes me wonder: Should it work?
>
No.
>
> I know I can solve this by simply putting multiple "rules" in one
> access_by_lua handler and then short circuiting it by ngx.exit(ngx.OK) but
> then I do have to remember to call ngx.exit(ngx.HTTP_FORBIDDEN) at the end
> or I have a security hole.
>
You can simply write a generic driver in Lua to dispatch your concrete rules.
Regards,
-agentzh