<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Thanks so much for your detailed answer. Works like a charm :)<br>
<br>
But i see i can't access this from LUA?<br>
<br>
> The <code>ngx.location.capture</code> and <code>ngx.location.capture_multi</code>
Lua methods cannot <br>
> capture
locations configured by ngx_echo module's <code>echo_location</code>,
<code>echo_location_async</code>, <code><br>
> echo_subrequest</code>, or <code>echo_subrequest_async</code>
directives. This
won't be fixed in the future due to technical problems :)<br>
<br>
but is it possible to get
<pre wrap="">echo_request_body</pre>
directly in nginx LUA? <br>
<br>
Thanks.<br>
<br>
Alexander<br>
<br>
<pre wrap="">
</pre>
<br>
On 16.03.2011 03:28, agentzh wrote:
<blockquote
cite="mid:AANLkTinZ0heBRQ+f+djYZHyBPPpfEwv2QdLw-9HC-X0g@mail.gmail.com"
type="cite">
<pre wrap="">On Wed, Mar 16, 2011 at 6:15 AM, Alexander Kunz <a class="moz-txt-link-rfc2396E" href="mailto:akunz@ntmedia.de"><akunz@ntmedia.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
Hello,
any chance to debug the -f function? I use the debug log, but get no
information about the file... /body1
shows me "test" but /body2 shows nothing... no error, no body content...
</pre>
</blockquote>
<pre wrap="">
Because there's no error in your /body2 request, no log is expected to
be printed ;)
</pre>
<blockquote type="cite">
<pre wrap=""> location /body1 {
echo_subrequest POST /sub -b 'test';
}
location /body2 {
echo_subrequest POST /sub -f /tmp/hello.txt;
}
location /sub {
echo "body: $echo_request_body";
}
</pre>
</blockquote>
<pre wrap="">
Why $echo_request_body is empty for /body2? Because "echo_subrequest
/sub -f /tmp/hello.txt" produces a request body that consists of
*file* buffers only (such that nginx does not bother reading the whole
disk file into RAM at once) and $echo_request_body only respects pure
*memory* buffers.
The following example comes from the ngx_echo's test suite:
location /main {
echo_subrequest POST /sub -f html/blah.txt;
}
location /sub {
echo "sub method: $echo_request_method";
# we don't need to call echo_read_client_body explicitly here
echo_request_body;
}
where html/blah.txt contains the following contents:
Hello, world
Then GET /main gives
sub method: POST
Hello, world
Cheers,
-agentzh
_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://nginx.org/mailman/listinfo/nginx">http://nginx.org/mailman/listinfo/nginx</a>
</pre>
</blockquote>
<br>
</body>
</html>