Nginx 是否也缓冲来自客户端的 http 请求?

Does Nginx also buffer http request from client?

我知道 Nginx 可以缓冲来自上游服务器的响应。

我的问题是,Nginx 是否也缓冲来自客户端的 http 请求?我的意思是,如果 Nginx 从客户端收到 http 请求,它会立即与上游服务器建立连接吗?或者它会在它得到一个完整的http请求后创建连接?

应用服务器的很多框架都采用了worker-thread-pool模型。如果客户端机器速度慢或远离 Nginx 和上游服务器,如果没有在 Nginx 端缓冲 http 请求,上游服务器将浪费相当多的 CPU 资源来等待完成 http 请求。

谢谢

引用自the proxy module wiki page

Note that when using the HTTP Proxy Module (or even when using FastCGI), the entire client request will be buffered in nginx before being passed on to the backend proxied servers.

此外,在 nginx 1.7 之前,无法禁用请求缓冲(参见 #251)。