# Big files truncated

**URL:** <https://www.ruby-forum.com/t/big-files-truncated/193425>\
**Category:** NGINX\
**Created:** [August 17, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/big-files-truncated/193425 "2010-08-17T15:02:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![axel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@axel](https://www.ruby-forum.com/u/axel)\
**Post date:** [August 17, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/big-files-truncated/193425/1 "2010-08-17T15:02:31Z")

</div>

Hi guys,

I get still the same issue on nginx 0.7.67. Medium and big files are  
sometimes (I don’t know when or why) truncated. I have a server  
configuration for static.mydomain.tld that is doing nothing else than  
sending static content (no PHP, CGI …).

server {  
listen 80;  
server\_name static.mydomain.tld;  
root /var/www/medias/;  
expires 90d;  
access\_log /var/log/nginx/medias\_access.log;  
error\_log /var/log/nginx/medias\_error.log notice;

```
    location /videos/ {
            expires -90d;
            send_timeout 600;
            keepalive_timeout 600 600;
            error_page 404 = /videos/video_not_found.png;
    }

    location /gallery/ {
            error_page 404 = /galerie/1x1.png;
    }

```

}

When it fails on images, I have half-downloaded images and when it fails  
on videos, the video playback stops after a couple a seconds.  
Here is a screenshot of failed images

Has anyone got the same issue? I really tried a lot of things but  
nothing did the trick. The hardest part is that I cannot reproduce that  
issue as I want. Very though to test then…  
Thanks for your help

Axel

---

<div class="post-metadata">

**Author:** ![axel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@axel](https://www.ruby-forum.com/u/axel)\
**Post date:** [August 17, 2010, 4:43pm UTC](https://www.ruby-forum.com/t/big-files-truncated/193425/2 "2010-08-17T16:43:16Z")

</div>

Hello!

On Tue, Aug 17, 2010 at 03:00:17PM +0200, Axel wrote:

> ```
> access_log /var/log/nginx/medias_access.log;
> error_page 404 = /galerie/1x1.png;
> }
> 
> ```
> 
> }
> 
> When it fails on images, I have half-downloaded images and when  
> it fails on videos, the video playback stops after a couple a  
> seconds. Here is a screenshot of failed images

Config looks sane and shouldn’t cause any problems.

Most likely reason is shortage of some system resources, e.g.  
you’ve run out of memory or socket buffers. Other possible  
reasons include:

- something like statefull firewall inbetween which run  
out of states and dropping random connections;

- nginx workers dying for some reason, likely unrelated to this  
particular server block.

Looking into error\_log may be helpfull. Note well: you may want  
to look into global error\_log as well, not only the one defined  
for this particular server.

Maxim D.

---

<div class="post-metadata">

**Author:** ![axel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@axel](https://www.ruby-forum.com/u/axel)\
**Post date:** [August 17, 2010, 7:27pm UTC](https://www.ruby-forum.com/t/big-files-truncated/193425/3 "2010-08-17T19:27:15Z")

</div>

Hi Maxim,

thanks for your reply. I don’t think firewall could have anything to do  
with this. And I don’t find any log related to crashed workers.  
All I have is:  
2010/07/28 18:19:49 [info] 28987#0: \*49 client closed prematurely  
connection while sending response to client, client: 213.31.XX.XX  
but I think this is not an issue as well.  
Nothing in nginx general logs, nothing in syslog

Is there any limit (memory, timeout) I should increase?

Thanks

Axel

Le 17 août 2010 à 16:42, Maxim D. a écrit :
