Hello!
On Wed, Jul 18, 2012 at 1:53 PM, Anatoli Makarevich wrote:
> Hi, @agentzh!
>
> My name is Anatoli, I am a Ruby developer from Russia!
>
Oh, nice to know you :)
> I am very impressed by your contribution and deep understanding on nginx and
> lua issues so this is why I am asking for your help.
>
Thanks :)
> The question is – "How to store the result of redis query to variable"? I
> need this to proxy different subdomains of different hosts to different
> servers. Quite a lot of different here)
>
> Could you please help me with that? I installed lua, redis2 modules but I am
> really stuck with storing result as a variable without rendering it.
>
There's a sample on the openresty.org site that does exactly what you want:
http://openresty.org/#DynamicRoutingBasedOnRedis
But nowadays I'd recommend the new lua-resty-redis library over
ngx_redis2 + lua-redis-parser + ngx.location.capture:
https://github.com/agentzh/lua-resty-redis
BTW, I've cc'd the openresty mailing list so that people can see our discussion:
https://groups.google.com/group/openresty
You're also very welcome to join the list and ask questions there ;)
Thanks!
-agentzh