Nginx truncate files than 1G

Gena Makhomed gmm at csdoc.com
Sun Jul 8 09:55:31 UTC 2012


On 08.07.2012 12:24, Maxim Dounin 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

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

5. or use X-Accel-Redirect at backend to avoid full transfer of file
(http://kovyrin.net/2006/11/01/nginx-x-accel-redirect-php-rails/)

6. or use https://github.com/defanator/mod_aclr2

-- 
Best regards,
  Gena




More information about the nginx mailing list