Client body buffering with FastCGI

Maxim Khitrov max at
Thu Feb 17 17:48:24 MSK 2011

Hello all,

I'm trying to configure AjaXplorer, a PHP/Ajax file manager, to work
behind nginx 0.8.54 on FreeBSD 7.3. The problem I'm running into is
the inability to upload files more than ~64 MB in size. Ideally, I'd
like to bump that limit up to 1 GB. I realize that HTTP is not ideal
for this, but other transfer methods are not an option.

PHP and nginx are both configured to accept 1 GB POST requests. As far
as I can tell, nginx buffers the contents of the entire upload to disk
before forwarding the request to the FastCGI process. This data is
then read from disk and written back to disk by PHP. The whole
write/read/write cycle is causing a timeout, first in nginx, and then
in the PHP process (though there may also be some other problem that I
haven't figured out yet).

For now, I'm curious whether there is a way to bypass the disk buffer
and have nginx start sending the request as soon as it has all the
headers? PHP can then buffer the entire request in memory and begin
processing it as soon as the last byte is received.

I'm also looking into the upload module for nginx, which eliminates
the need to buffer the request in memory. However, AjaXplorer isn't
written to work with this module, so it would require some effort on
my part to modify the code. I would prefer to avoid doing this, if

- Max

More information about the nginx mailing list