# How to get a value from upstream and redirect to another url according to the value?

**URL:** <https://www.ruby-forum.com/t/how-to-get-a-value-from-upstream-and-redirect-to-another-url-according-to-the-value/205819>\
**Category:** NGINX\
**Created:** [April 16, 2011, 9:58am UTC](https://www.ruby-forum.com/t/how-to-get-a-value-from-upstream-and-redirect-to-another-url-according-to-the-value/205819 "2011-04-16T09:58:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 16, 2011, 9:58am UTC](https://www.ruby-forum.com/t/how-to-get-a-value-from-upstream-and-redirect-to-another-url-according-to-the-value/205819/1 "2011-04-16T09:58:50Z")

</div>

hello

i want to write a module , in this module i first get a value from the  
memcache upstream , then i will redirect the url according to the value  
i  
got?

i know how to get a value from memcache upstream, but i don’t not know  
where  
and when and how i redirect to another url.

thanks for your reading .

–  
\*

---

<div class="post-metadata">

**Author:** ![notedit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@notedit](https://www.ruby-forum.com/u/notedit)\
**Post date:** [April 16, 2011, 11:20am UTC](https://www.ruby-forum.com/t/how-to-get-a-value-from-upstream-and-redirect-to-another-url-according-to-the-value/205819/2 "2011-04-16T11:20:22Z")

</div>

HI,

You can use the eval moudle([Nginx eval module (v 1.0.1)](http://www.grid.net.ru/nginx/eval.en.html)).

2011/4/16 notedit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
