Nginx proxy_buffering

Please add the following to the Nginx manual:

proxy_buffering off;

As this disables the nginx server caching the files on disk before sending them to the user.
For example, The seafile server server reads a block, pushes it to nginx. nginx saves the file on the disk as it exceeds the buffer. The result is then read and send to the user. With the proxy_buffering off, this is prevented.

Module ngx_http_proxy_module

Enables or disables buffering of responses from the proxied server.

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. 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. nginx will not try to read the whole response from the proxied server. The maximum size of the data that nginx can receive from the server at a time is set by the proxy_buffer_size directive.

You can start a PR on it by your self at Github, but are your sure that this is not mentioned in the manual?

P.S You should also turn of gzip @ nginx.conf to speed everything up :slight_smile:

I’ve send it in as an issue, as there is no code on GIT to change. But good point.
The manual doesn’t say anything about it:

My server is IO restricted which results in sending and receiving files literally twice as fast as before.

what is the current state of knowledge regarding proxy_buffering off;?
This is not yet included in the official seafile documentation.

I had the problem the last weeks that my root partition was always written full with files in the /var/cache/nginx/proxy_temp folder.
Only after I added proxy_buffering off; to my nginx config, the problem did not occur anymore

Doesn’t anyone have an opinion on this?

Hey Guys,

this problem also ocurs if you have deployed seafile with docker! Downloading large files always fails with the default config! You have to change the nginx conf file inside the container and reload the nginx process.

Please fix this in your config and in your docker images!