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.
In the meantime, the rest of the buffers can be used for reading the response and, if needed, buffering part of the response to a temporary file.
By default, Allows starting a background subrequest to update an expired cache item, while a stale cached response is returned to the client.
Similar functionality can be found in Varnish 4 and in Squid this is called Collapsed Forwarding.
Example Configuration Directives proxy_bind proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_background_update proxy_cache_bypass proxy_cache_convert_head proxy_cache_key proxy_cache_lock proxy_cache_lock_age proxy_cache_lock_timeout proxy_cache_max_range_offset proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_purge proxy_cache_revalidate proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_cookie_domain proxy_cookie_path proxy_force_ranges proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_http_version proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_limit_rate proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_next_upstream_timeout proxy_next_upstream_tries proxy_no_cache proxy_pass proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_request_buffering proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_certificate proxy_ssl_certificate_key proxy_ssl_ciphers proxy_ssl_crl proxy_ssl_name proxy_ssl_password_file proxy_ssl_server_name proxy_ssl_session_reuse proxy_ssl_protocols proxy_ssl_trusted_certificate proxy_ssl_verify proxy_ssl_verify_depth proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path Embedded Variables In order for this parameter to work, it is necessary to run nginx worker processes with the superuser privileges and configure kernel routing table to intercept network traffic from the proxied server.
The following fields can be ignored: “X-Accel-Redirect”, “X-Accel-Expires”, “X-Accel-Limit-Rate” (1.1.6), “X-Accel-Buffering” (1.1.6), “X-Accel-Charset” (1.1.6), “Expires”, “Cache-Control”, “Set-Cookie” (0.8.44), and “Vary” (1.7.7).
If not disabled, processing of these header fields has the following effect: is specified in bytes per second. The limit is set per a request, and so if nginx simultaneously opens two connections to the proxied server, the overall rate will be twice as much as the specified limit.
Defines conditions under which the response will not be taken from a cache.
Writing to temporary files is controlled by the proxy_max_temp_file_size and proxy_temp_file_write_size directives.
When buffering is disabled, the response is passed to a client synchronously, immediately as it is received.
Buffering can also be enabled or disabled by passing “ of the buffers used for reading a response from the proxied server, for a single connection.
By default, the buffer size is equal to one memory page. of buffers that can be busy sending a response to the client while the response is not yet fully read.