nginx will not try to read the whole response from the proxied server.
By default, the buffer size is equal to one memory page. When buffering is enabled, nginx receives a response from the proxied server as soon as possible, saving it into the buffers set by the proxy_buffer_size and proxy_buffers directives.
If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk.
This directive sets the maximum One should bear in mind that passing a request to the next server is only possible if nothing has been sent to a client yet.
That is, if an error or timeout occurs in the middle of the transferring of a response, fixing this is impossible.
However, these entries will remain on the disk until they are deleted for either inactivity, or processed by the cache purger (1.7.12), or a client attempts to access them.
Example configuration: parameter permits using a stale cached response if it is currently being updated.
A cached response is first written to a temporary file, and then the file is renamed.
Starting from version 0.8.9, temporary files and the cache can be put on different file systems.
However, be aware that in this case a file is copied across two file systems instead of the cheap renaming operation.