Serving executables over web

Hello everyone, I’ve got the following lines in my host.conf that I’m
including into my main nginx.conf file

location ~* ^.+.(pdf|mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|
ppt|txt|tar|mid|midi|wav|rtf|mpeg|jpg|jpeg|gif|png|ico|css|bmp|js)$ {
root /www/django/django_projects/son/static;
limit_rate 5000K;
access_log /www/django/django_projects/log/
inform_nginx_django_media.log download;
}

It works fine for all my js and css files, I can see them in the log
no problem, but we have two 10mb .exe files that are taking an
incredibly long time to download, and I can’t find any mention of them
in the media log file. As you can see exe is in the list of
executables, and the files themselves are definitely within the root
defined.

Can anyone think of any reason for this?

It’s as if the fastcgi that the django is using to run is serving the
files instead.

Any help on this would be greatly appreciated.

Matt

Sorry everyone, my bad

:slight_smile:

It is serving it, it only writes the record to the log once the file
has completed downloading it :slight_smile:

I know need to work out why it’s taking so long to download, that’s a
whole different ballgame

:slight_smile:

aha!!

Solved that too

The file was marginally larger in size than the client_max_body_size
variable in the main nginx.conf size.

Tweaked that up a bit and it flies down now.

matt

On Friday 07 November 2008, matt davies wrote:

aha!!

Solved that too

The file was marginally larger in size than the client_max_body_size
variable in the main nginx.conf size.

Tweaked that up a bit and it flies down now.

client_max_body_size limits size of upload.
It has no effect on download.

Hi Roxis

Well I’ve got a 10.3 mb file, if I set the client_max_body_size to
10mb, it takes approximately 8 minutes to download.

If I set it to client_max_body_size 15 mb it downloads at maximum
network speed.

I’ve just tried switching it back and I’m promising you that is what
is happening without changing anything else.

I think this might be a case of ‘works for me’ :slight_smile:

matt

Hello!

On Fri, Nov 07, 2008 at 03:26:13PM +0000, matt davies wrote:

mime types and how the PDF file was handled compared to the EXE file.

No clue as to what is happening now

Just a guess: antivirus on server/client/firewall?

Can anyone point me at any documentation on how nginx handles
downloading files?

It’s written mostly in C language, you should have it with nginx
itself. :slight_smile:

Maxim D.

Na, not that, it doesn’t happen in safari, just firefox.

No firewall on client or server

hmm, once I’ve downloaded the file once, even if I’ve deleted the file
from the area it downloads to, it takes seconds to download. Anyone
know where the caching is taking place?

:slight_smile:

I’ve just worked out that download speed has absolutely nothing to do
with client_max_body_size as Roxis correctly pointed out. What was
happening my end was that I had already successfully downloaded the
exe once, so the next download of the same file was obviously much
quicker :slight_smile:

The PDF I put on the site of roughly the same size was a very fast
download straight away, so I’m guessing it’s something to do with the
mime types and how the PDF file was handled compared to the EXE file.

No clue as to what is happening now

Can anyone point me at any documentation on how nginx handles
downloading files?

If its just firefox, do you have any extensions that could be jumping in
on the action? Virus checkers, “download accelerators”, etc?

matt davies wrote:

:slight_smile:
downloading files?

It’s written mostly in C language, you should have it with nginx
itself. :slight_smile:

Maxim D.

Phillip B Oldham
The Activity People
[email protected] mailto:[email protected]


Policies

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to
anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.