How do proxy_module response buffering options work?

liuzhida nginx-forum at
Fri Nov 18 02:52:57 UTC 2011

> Additionally, there is proxy_max_temp_file_size,
> which controls how 
> much data may be written to disk.  Once temp file
> size becomes 
> bigger - nginx pauses reading data from upstream
> until data from 
> temporary file is sent to client.

do you mean if a response size is larger than all the proxy buffers,
after some part of the response been written into buffers, the rest of
data which can't be written into buffers will be written into temp_file?
for every single response? the proxy_max_temp_file_size are global or
per request?
for example the upstream response is 2000 bytes. Nginx is configured
with 4 buffers, each 100 bytes in size. is that nginx deal with this
single response with written the 400 bytes of response into buffer and
written the 1600 bytes into temp_file? and after the buffer is
completely send, Nginx will read the rest of response data from the
temp_file and written into buffer? 



Posted at Nginx Forum:,193347,218535#msg-218535

More information about the nginx mailing list