upyun/slardar

How to apply different lua scripts to one host?

enzocq opened this issue · 2 comments

From the "ReadMe", I can know slardar can bind lua script with the host by the key, as below:
we have several service in different host like "api.a.com", "api.b.com", so we can create lua script in consul by keys: "config/slardar/lua/script.api.a.com" , "config/slardar/lua/script.api.b.com".

The question is if we need apply serveral lua scripts on one host, how to do this?
For example, we need to create the auth lua and log lua, we can't do this by consul if we want to separate these lua script, or we need to implement this function in ngx_lua module?

https://github.com/upyun/slardar/blob/master/nginx/app/src/rewrite.lua#L19
you can use different skeys in rewrite phase and log phase

Thanks!