Welcome! Log In Create A New Profile

Advanced

Re: echo_location Not Working

csg
September 27, 2012 03:30AM
On 2012-09-26 19:03, adamchal wrote:
> 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/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.

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://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

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.3.6</center>
</body>
</html>
world
took 1.001 sec for total.

Without the "GET":

$ curl -s -o - -D - -H 'Host: t17.example.com' 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?

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

echo_location Not Working

adamchal September 26, 2012 01:03PM

Re: echo_location Not Working

csg September 27, 2012 03:30AM

Re: echo_location Not Working

adamchal September 27, 2012 07:40AM

Re: echo_location Not Working

agentzh September 27, 2012 02:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready