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;
      }

Attachment: proxy_internal_body_length.patch
Description: Binary data

_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to