Welcome! Log In Create A New Profile

Advanced

[BUG] Wrong Content-Length shared between main request and subrequests in http proxy module

lanshun zhou
May 02, 2013 11:22PM
Nginx uses a variable "$proxy_internal_body_length" for the
"Content-Length" header in http proxy module, which is cacheable and shared
between the main request and all subrequests by default.
Although ctx->internal_body_length is calculated for each
request/subrequest, the string format is cached after the first generation,
and this may be wrong for other subrequests.

The following simple config can reproduce the problem, where xxxxx is a
place that can receive post data. curl --data-binary "xxxxxxxxxxxxxxx"
localhost/test.html will cause the client hang.

location = /test.html {
add_after_body /vpost;

proxy_pass http://xxxxx;
}

location /vpost {
proxy_set_body "in vpost";

proxy_pass http://xxxxx;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[BUG] Wrong Content-Length shared between main request and subrequests in http proxy module Attachments

lanshun zhou 916 May 02, 2013 11:22PM

Re: [BUG] Wrong Content-Length shared between main request and subrequests in http proxy module

Maxim Dounin 594 May 11, 2013 01:30PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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