# Can not get the value from eval module

**URL:** <https://www.ruby-forum.com/t/can-not-get-the-value-from-eval-module/205962>\
**Category:** NGINX\
**Created:** [April 19, 2011, 6:25pm UTC](https://www.ruby-forum.com/t/can-not-get-the-value-from-eval-module/205962 "2011-04-19T18:25:37Z")\
**Posts on this page:** 3\
**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 19, 2011, 6:25pm UTC](https://www.ruby-forum.com/t/can-not-get-the-value-from-eval-module/205962/1 "2011-04-19T18:25:37Z")

</div>

sorry about i send the same email secondly, i still can not figure it  
out.

i use the nginx eval module, echo module and memc module, so i did a  
test.  
but when i curl 127.0.0.1/one/ , it just stuck there, i can not get the  
output.  
when i check the value of system\_uid in memcache , it really changed.  
but why it was stuck there? when i curl 127.0.0.1/two/ , i can get the  
correct output.  
i test in my two pc, i get the same result.

some one can help me ?

```
    location /one/ {
        eval $uid {
            set $memc_cmd incr;
            set $memc_key 'system_uid';
            set $memc_value 1;
            memc_pass 127.0.0.1:11211;
            echo 'test';

        }
        echo 'helloworld';

    }
    location /two/ {
        echo 'helloworld';
        echo_flush;
    }

```

–  
\*

---

<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 20, 2011, 6:51am UTC](https://www.ruby-forum.com/t/can-not-get-the-value-from-eval-module/205962/2 "2011-04-20T06:51:24Z")

</div>

On Wed, Apr 20, 2011 at 12:24 AM, notedit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> sorry about i send the same email secondly, i still can not figure it out.  
> i use the nginx eval module, echo module and memc module, so i did a test.  
> but when i curl127.0.0.1/one/, it just stuck there, i can not get the  
> output.  
> when i check the value of system\_uid in memcache , it really changed.  
> but why it was stuck there? when i curl 127.0.0.1/two/ , i can get the  
> correct output.  
> i test in my two pc, i get the same result.  
> some one can help me ?

The official ngx\_eval module can only work with content handlers that  
explicitly support the “nginx subrequest in memory” feature. Just a  
few modules support that, like ngx\_proxy, ngx\_memcached, and ngx\_memc.  
My ngx\_echo does not support it, nor does ngx\_fastcgi.

You can try out my fork of ngx\_eval instead:

```
https://github.com/agentzh/nginx-eval-module

```

But as the README page of my fork has already says, it’s recommended  
to use ngx\_lua to do such tasks because it is more flexible and more  
reliable.

Cheers,  
-agentzh

---

<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 20, 2011, 6:55am UTC](https://www.ruby-forum.com/t/can-not-get-the-value-from-eval-module/205962/3 "2011-04-20T06:55:08Z")

</div>

On Wed, Apr 20, 2011 at 12:24 AM, notedit [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> sorry about i send the same email secondly, i still can not figure it out.  
> i use the nginx eval module, echo module and memc module, so i did a test.

Also, do not use the echo and memc\_pass directives in a single  
location (an eval block creates an anonymous location as well).

BTW, If you do not understand my reply, just follow it up and ask.  
Sending a clone of your original email is impolite and annoying  
because it’s a waste of our time and our bandwidth.

Cheers,  
-agentzh
