Truncated mp3 files when proxy

Hi all,

i’ve a strange problem: in my conf i use proxy for external requests for
mp3 download to our backends in this way:

location ^~ /tag/ {
client_body_timeout 180;
proxy_pass http://192.168.61.226:8888;
proxy_redirect default;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Org-host $host;
proxy_set_header X-Org-uri $request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Server;
}

From 1 to 3% of the requests the backend servers sent to nginx more
bytes then nginx logs and serves. In this example the backend sends
9445489 bytes and from nginx logs i see only 1994793 bytes sent.

This is a sample log lines:
$IP ADDRESS - - [09/Nov/2009:01:21:20 +0100] “GET
/tag/10233569/Piu_di_un_giorno_in_.mp3 HTTP/1.1” 200 1994793 “”
“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
2.0.50727)” “-” 66.040

In every case the request_time is > 60 seconds (my nginx version is
0.6.39).

Unfortunately i’m unable to reproduce the problem by myself. Any idea of
how to reproduce it ?

Is it a good idea to upgrade to 0.7.63 version ?

Any suggestions are welcome. Thanks in advance.

Daniele

Should this problem be related to socket leak bug fixed in version
0.7.25 ?

http://www.ruby-forum.com/topic/187772#819552

It seems the same behavior, i serve big files and sometimes its seem to
be truncated (in the example above 1994793 bytes instead of 9445489).

Daniele M. ha scritto:

Hello!

On Tue, Nov 10, 2009 at 11:46:04AM +0100, Daniele M. wrote:

Should this problem be related to socket leak bug fixed in version 0.7.25 ?

Nginx-0.7.59 - NGINX - Ruby-Forum

No, unless you consider “related” to mean “both happen in real
life”.

It seems the same behavior, i serve big files and sometimes its seem
to be truncated (in the example above 1994793 bytes instead of
9445489).

Nothing forces clients to download full reply. Just hitting
“cancel” by user explains everything here, not even talking about
connectivity loss etc.

Maxim D.

Hello!

On Mon, Nov 09, 2009 at 05:06:28PM +0100, Daniele M. wrote:

proxy_set_header Host $host;
This is a sample log lines:
$IP ADDRESS - - [09/Nov/2009:01:21:20 +0100] “GET
/tag/10233569/Piu_di_un_giorno_in_.mp3 HTTP/1.1” 200 1994793 “”
“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
2.0.50727)” “-” 66.040

In every case the request_time is > 60 seconds (my nginx version is 0.6.39).

Looks like timeout writing to client. Try looking into error log,
it should have details.

Unfortunately i’m unable to reproduce the problem by myself. Any
idea of how to reproduce it ?

Is it a good idea to upgrade to 0.7.63 version ?

It’s probably a good idea, but unlikely to resolve anything here
(as it looks like there is nothing to resolve…).

Maxim D.