Caching, buffering, and temporary files

Ideally, as much as possible, you should reduce the amount of requests being forwarded to the backend server. The following directive will help you build a caching system, as well as control buffering options and the way Nginx handles temporary files:

Directive

Description

proxy_buffer_size

Context: httpserverlocation

Sets the size of the buffer for reading the beginning of the response from the backend server, which usually contains simple header data.

The default value corresponds to the size of 1 buffer, as defined by the previous directive  (proxy_buffers).

Syntax: Numeric value (size)

Example: proxy_buffer_size 4k;

proxy_buffering, proxy_request_buffering

Context: http

Get Nginx HTTP Server - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.