Hello!
On Fri, Mar 18, 2016 at 7:03 PM, jonathan wrote:
> openresty is great. i've protoyped a system that handles virtual host
> configurations with custom ssl very quickly, caching the config data in
> redis and nginx itself.
>
> in order to make this work, i have a python script that pre-generates all
> the data loaded it into redis.
>
> i know i could generate this on-the-fly using between the postgres module
> and lua, but I was wondering if I could request the configuration data from
> an backend service that generates json.
>
> no one seems to do this in the forum, but it looks like the
> ngx.location.capture could query an upstream location (via proxypass or
> uwsgi), or i could use the 3rd party lua-resty-http to query another
> service. openresty has a json parser too.
>
CloudFlare does something like this all the time in its Lua CDN
network globally.
BTW, because you mention redis, OpenResty comes with a lua-resty-redis
library that can talk to redis nonblockingly.
Regards,
-agentzh