diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 780528a33..d5e6dd5e6 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -569,8 +569,11 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) } } - if (r->request_body && r->request_body->temp_file && r == r->main) { - + if (r->request_body + && r->request_body->buf + && r->request_body->temp_file + && r == r->main) + { /* * the r->request_body->buf can be reused for one request only, * the subrequests should allocate their own temporay bufs