Hello!
On Tue, Aug 12, 2014 at 7:37 AM, Ajay Bodhe wrote:
> I guess redis2-nginx-module-master only allows redis access through configs
> If I wanna access redis from another openresty C module can it be done?
> Is it possible to call one modules code from another module?
Yes, via nginx subrequests. You can check out ngx_echo's
echo_subrequest directive or ngx_lua's ngx.location.capture()'s
implementation for such examples.
But as I've said in an earlier thread, it's much easier, more
efficient, and also more flexible to just use cosocket-based Lua
drivers like lua-resty-redis to do such things.
We created the ngx_lua module 5 years ago because we had got tired of
coding complicated nginx C modules which did not give much gain but
just a lot of pain. I can assure you that you won't have fun perusing
the pure nginx C module development route ;)
Regards,
-agentzh