# Echo\_location Not Working

**URL:** <https://www.ruby-forum.com/t/echo-location-not-working/223246>\
**Category:** NGINX\
**Created:** [September 26, 2012, 7:03pm UTC](https://www.ruby-forum.com/t/echo-location-not-working/223246 "2012-09-26T19:03:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 26, 2012, 7:03pm UTC](https://www.ruby-forum.com/t/echo-location-not-working/223246/1 "2012-09-26T19:03:57Z")

</div>

Anybody having issues with the echo\_location (and echo\_location\_async)  
directive? I have tried to get this to work with v1.1.18 and v1.3.6,  
and  
they both exhibit the same behavior. Basically, only the output from  
the  
/main block is echo’d out.

My nginx config (basically a copy-and-paste) from the echo module’s  
documentation:

```
location /main {
    echo_reset_timer;
    echo_location_async GET /sub1;
    echo_location /sub2;
    echo "took $echo_timer_elapsed sec for total.";
}
location /sub1 {
    echo_sleep 2;
    echo hello;
}
location /sub2 {
    echo_sleep 1;
    echo world;
}

```

# curl -D /dev/stdout [http://localhost/main](http://localhost/main)

HTTP/1.1 200 OK  
Server: nginx/1.3.6  
Date: Wed, 26 Sep 2012 16:37:37 GMT  
Content-Type: text/plain  
Transfer-Encoding: chunked  
Connection: keep-alive

took 1.002 sec for total.

Posted at Nginx Forum:

> **[echo\_location Not Working](https://forum.nginx.org/read.php?2,231107,231107#msg-231107)**
>
> Anybody having issues with the echo\_location (and echo\_location\_async) directive? I have tried to get this to work with v1.1.18 and v1.3.6, and they both exhibit the same behavior. Basically, only the output from the /main block is echo'd out. My...

---

<div class="post-metadata">

**Author:** ![adamchal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@adamchal](https://www.ruby-forum.com/u/adamchal)\
**Post date:** [September 27, 2012, 9:29am UTC](https://www.ruby-forum.com/t/echo-location-not-working/223246/2 "2012-09-27T09:29:18Z")

</div>

On 2012-09-26 19:03, adamchal wrote:

> ```
> location /sub2 {
> 
> ```
> 
> Transfer-Encoding: chunked  
> Connection: keep-alive
> 
> took 1.002 sec for total.

Hmm, works for me as expected after removing the “GET” at  
“echo\_location\_async”, using Nginx 1.3.6 and  
agentzh-echo-nginx-module-d3eb42d (version 0.41). But even with the  
“GET” which will fail the /sub1 subrequest (status 404), you should  
still see the output of the 404 page (as a result of the /sub1  
subrequest), the output of /sub2 plus the one of /main.

With the “GET”:

$ curl -s -o - -D - -H ‘Host: [t17.example.com](http://t17.example.com)’ [http://127.0.0.1/main](http://127.0.0.1/main)  
HTTP/1.1 200 OK  
Server: nginx/1.3.6  
Date: Thu, 27 Sep 2012 07:16:24 GMT  
Content-Type: application/octet-stream  
Transfer-Encoding: chunked  
Connection: keep-alive

404 Not Found
# 404 Not Found

* * *
nginx/1.3.6 world took 1.001 sec for total.

Without the “GET”:

$ curl -s -o - -D - -H ‘Host: [t17.example.com](http://t17.example.com)’ [http://127.0.0.1/main](http://127.0.0.1/main)  
HTTP/1.1 200 OK  
Server: nginx/1.3.6  
Date: Thu, 27 Sep 2012 07:16:43 GMT  
Content-Type: application/octet-stream  
Transfer-Encoding: chunked  
Connection: keep-alive

hello  
world  
took 1.001 sec for total.

Which version of the echo module are you using? Debug logs?

---

<div class="post-metadata">

**Author:** ![adamchal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@adamchal](https://www.ruby-forum.com/u/adamchal)\
**Post date:** [September 27, 2012, 1:41pm UTC](https://www.ruby-forum.com/t/echo-location-not-working/223246/3 "2012-09-27T13:41:08Z")

</div>

I’m an idiot, it’s because I didn’t have the SSI module compiled in.

Posted at Nginx Forum:

> **[Re: echo\_location Not Working](https://forum.nginx.org/read.php?2,231107,231141#msg-231141)**
>
> Anybody having issues with the echo\_location (and echo\_location\_async) directive? I have tried to get this to work with v1.1.18 and v1.3.6, and they both exhibit the same behavior. Basically, only the output from the /main block is echo'd out. My...

---

<div class="post-metadata">

**Author:** ![adamchal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@adamchal](https://www.ruby-forum.com/u/adamchal)\
**Post date:** [September 27, 2012, 8:02pm UTC](https://www.ruby-forum.com/t/echo-location-not-working/223246/4 "2012-09-27T20:02:11Z")

</div>

Hello!

On Wed, Sep 26, 2012 at 10:03 AM, adamchal wrote:

> ```
> echo_location_async GET /sub1;
> 
> ```

I think you really mean “echo\_subrequest\_async” here? The  
echo\_location\_async directive does not take a request method as its  
first argument, so the “GET” argument above will be interpreted as the  
subrequest URI (and “/sub1” will be taken as the querystring), which  
is surely not what you want 😉 See the documentation for details:

```
http://wiki.nginx.org/HttpEchoModule#echo_location_async

```

And also

```
http://wiki.nginx.org/HttpEchoModule#echo_subrequest_async

```

Best regards,  
-agentzh
