Welcome! Log In Create A New Profile

Advanced

Re: nginx+lua reverse proxy empty body (weird repeatable behavior)

agentzh
November 29, 2012 09:16PM
Hello!

On Thu, Nov 29, 2012 at 1:51 AM, Bart van Deenen wrote:
> It seems the body_filter_by_lua section is bypassed somehow, it just doesn't receive the proxied data. I have this simplified testcase which at least for my setup is completely repeatable. See below.
>

With your (exact) code sample, I cannot see any issues with
ngx_openresty 1.2.4.9 on Linux x86_64.

For a *single* request to location / (note: not multiple!), I'm
getting 26 non-empty data chunks:

$ grep 'The body is' logs/error.log | wc -l
26

and also one empty data chunk (which is generated by ngx_proxy to
solely signal the end of the body):

$ grep 'has empty body' logs/error.log | wc -l
1

You can try to scan your error.log on your side.

For big enough response bodies, it's common to see multiple data
chunks emitted by ngx_proxy to the output body filter chain. And your
body_filter_by_lua handler will be called multiple times, one time for
one data chunk, for a *single* response.

BTW, please post such questions to the openresty-en mailing list
(https://groups.google.com/group/openresty-en ) instead so that I can
see your mails sooner rather than later :)

Best regards,
-agentzh

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

RE: nginx+lua reverse proxy empty body (weird repeatable behavior)

Bart van Deenen November 29, 2012 04:52AM

Re: nginx+lua reverse proxy empty body (weird repeatable behavior)

agentzh November 29, 2012 09:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
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