Buffer messages in log even with buffering turned off

Francis Daly francis at daoine.org
Mon Jan 28 19:43:03 UTC 2013

On Mon, Jan 28, 2013 at 11:25:12AM -0800, Christopher Opena wrote:
> On Mon, Jan 28, 2013 at 10:58 AM, Francis Daly <francis at daoine.org> wrote:

> > If you want to ensure that the client request body is not buffered to
> > disk, you want to make sure that your client_body_buffer_size is larger
> > than your client_max_body_size. And be willing to refuse any client
> > request body bigger than that.

> Thanks for the rapid reply, Francis.  So it seems that even if we disable
> client request body size checking altogether (setting to 0), we still have
> to set all the other client_body_ checks?

The only client body checks are client_max_body_size and
client_body_timeout. The other client_body_* directives are (mostly)
independent of those.

When the client sends something to nginx, nginx buffers it somewhere
before sending it upstream. That "somewhere" can be disk or ram.

If it is bigger than your configured client_body_buffer_size, it goes
to disk, and lets you know that that happened.

> The primary aim is to just let
> Nginx pass through any traffic regardless of size because we are mostly
> using Nginx as a proxy / pass-through / load-balancing mechanism doing a
> hand-off to Apache until we can finally get our app off Apache and fully
> convert to Nginx.

That's what nginx does. Except that it buffers input before sending
upstream. Occasional buffering to disk isn't a bad thing.

Francis Daly        francis at daoine.org

More information about the nginx mailing list