# How to call redis2-nginx-module or any other module from another module

**URL:** <https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503>\
**Category:** NGINX\
**Created:** [August 12, 2014, 2:17pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503 "2014-08-12T14:17:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 12, 2014, 2:17pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503/1 "2014-08-12T14:17:10Z")

</div>

redis2-nginx-module is written with all location configs.  
Does it mean that the module can only be called from browser with some  
url?  
If I want to introduce new module into reuest processing path & call  
redis2-nginx-module to fetch data from redis how I can do it?

Posted at Nginx Forum:

> **[How to call redis2-nginx-module or any other module from another module](https://forum.nginx.org/read.php?2,252501,252501#msg-252501)**
>
> redis2-nginx-module is written with all location configs. Does it mean that the module can only be called from browser with some url? If I want to introduce new module into reuest processing path & call redis2-nginx-module to fetch data from...

---

<div class="post-metadata">

**Author:** ![ajaybodhe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ajaybodhe](https://www.ruby-forum.com/u/ajaybodhe)\
**Post date:** [August 12, 2014, 2:35pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503/2 "2014-08-12T14:35:39Z")

</div>

If you need to call redis from your code, you can take a look on  
redis\_nginx\_adapter [https://github.com/wandenberg/redis\_nginx\_adapter](https://github.com/wandenberg/redis_nginx_adapter).  
But, if you want to get the value from your “config” and use it there,  
probably you have to use some other language like perl or lua,  
I’m not 100% sure

---

<div class="post-metadata">

**Author:** ![ajaybodhe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ajaybodhe](https://www.ruby-forum.com/u/ajaybodhe)\
**Post date:** [August 12, 2014, 4:02pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503/3 "2014-08-12T16:02:05Z")

</div>

By default redis2-nginx-module execute some commands on redis and return  
the redis response to the client directly.  
So you receive something like  
+OK  
$5  
world

If you want to manipulate this response on you nginx.conf (“config”) you  
have to do more work, probably using another language like lua.  
If you are ok with your client receiving this kind of answer you do not  
have to worry.

---

<div class="post-metadata">

**Author:** ![ajaybodhe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ajaybodhe](https://www.ruby-forum.com/u/ajaybodhe)\
**Post date:** [August 12, 2014, 3:37pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503/4 "2014-08-12T15:37:02Z")

</div>

Thanks @wandenberg.

Can you clarify more on, what do you mean by getting the value from  
“config”  
:

But, if you want to get the value from your “config” and use it there,

Posted at Nginx Forum:

> **[Re: How to call redis2-nginx-module or any other module from another module](https://forum.nginx.org/read.php?2,252501,252506#msg-252506)**
>
> redis2-nginx-module is written with all location configs. Does it mean that the module can only be called from browser with some url? If I want to introduce new module into reuest processing path & call redis2-nginx-module to fetch data from...

---

<div class="post-metadata">

**Author:** ![ajaybodhe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ajaybodhe](https://www.ruby-forum.com/u/ajaybodhe)\
**Post date:** [August 12, 2014, 10:48pm UTC](https://www.ruby-forum.com/t/how-to-call-redis2-nginx-module-or-any-other-module-from-another-module/231503/5 "2014-08-12T22:48:21Z")

</div>

Hello!

On Tue, Aug 12, 2014 at 5:16 AM, ajaybodhe wrote:

> redis2-nginx-module is written with all location configs.  
> Does it mean that the module can only be called from browser with some url?  
> If I want to introduce new module into reuest processing path & call  
> redis2-nginx-module to fetch data from redis how I can do it?

See my reply on the openresty-en mailing list here:

> **[redis2-nginx-module-master module usage from other modules](https://groups.google.com/g/openresty-en/c/P-A7mzgX4SU/m/ieuZa3GgRx4J)**

BTW, please do not cross-post your questions between openresty-en and  
nginx mailing lists because most of the people on the former should be  
on the latter as well. Thank you for your cooperation.

Best regards,  
-agentzh
