upyun / slardar

Updating your upstream list and run lua scripts without reloading Nginx.
493 stars 111 forks source link

How to apply different lua scripts to one host? #7

Closed enzocq closed 7 years ago

enzocq commented 7 years ago

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?

huangnauh commented 7 years ago

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

enzocq commented 7 years ago

Thanks!