Nginx truncate files than 1G

Hi my nginx truncate files than 1 G

Posted at Nginx Forum:

-------- Original-Nachricht --------

Datum: Sat, 7 Jul 2012 08:49:02 -0400 (EDT)
Von: “Adrian Janeczek” [email protected]
An: [email protected]
Betreff: Nginx truncate files than 1G

Hi my nginx truncate files than 1 G

Wow! So much information at once? I am not sure if we here can
handle that much information!

Would it be possible for you to provide at least some minimal
information like what version of nginx you are using, what arch, what
exactly you are trying to do, nginx configuration, etc…

Hello!

On Sat, Jul 07, 2012 at 08:49:02AM -0400, Adrian Janeczek wrote:

Hi my nginx truncate files than 1 G

Most likely it’s due to your backend closing connection due to
timeout, as nginx stop receiving response for a while when it hits
proxy_max_temp_file_size, which is 1G by default.

Possible solutions are:

  1. Use lower proxy_max_temp_file_size to avoid timeouts on
    backends. You may even want to disable disk buffering completely,
    by using “proxy_max_temp_file_size 0;”.

  2. Use bigger proxy_max_temp_file_size to make sure responses are
    always buffered by nginx.

  3. Use bigger timeouts on your backend.

See here for more details:

http://nginx.org/r/proxy_max_temp_file_size

Maxim D.

On 08.07.2012 12:24, Maxim D. wrote:

by using “proxy_max_temp_file_size 0;”.

  1. Use bigger proxy_max_temp_file_size to make sure responses are
    always buffered by nginx.

  2. Use bigger timeouts on your backend.

See here for more details:

Module ngx_http_proxy_module

  1. send static content directly by nginx, without backend server at all
    (proxy to backend only requests to dynamic content: *.php, etc)

  2. or use X-Accel-Redirect at backend to avoid full transfer of file
    (Using X-Accel-Redirect in Nginx to Implement Controlled Downloads :: Oleksiy Kovyrin)

  3. or use GitHub - defanator/mod_aclr2: Module for Apache 2.x which automates serving static content with NGINX local proxy


Best regards,
Gena