Forum: NGINX Serving executables over web

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matt D. (Guest)
on 2008-11-07 14:09
(Received via mailing list)
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
Matt D. (Guest)
on 2008-11-07 14:31
(Received via mailing list)
Sorry everyone, my bad

:-)

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

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

:-)
Matt D. (Guest)
on 2008-11-07 14:54
(Received via mailing list)
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
Roxis (Guest)
on 2008-11-07 14:57
(Received via mailing list)
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.
Matt D. (Guest)
on 2008-11-07 15:35
(Received via mailing list)
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' :-)

matt
Matt D. (Guest)
on 2008-11-07 17:40
(Received via mailing list)
:-)

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 :-)

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?
Maxim D. (Guest)
on 2008-11-07 18:02
(Received via mailing list)
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. :)

Maxim D.
Matt D. (Guest)
on 2008-11-07 18:29
(Received via mailing list)
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?
Phillip B Oldham (Guest)
on 2008-11-07 18:35
(Received via mailing list)
Attachment: phill.vcf (0 Bytes)
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:
>
>>> :-)
>>> downloading files?
>>
>> It's written mostly in C language, you should have it with nginx
>> itself. :)
>>
>> Maxim D.
>>
>
>
>

--

*Phillip B Oldham*
The Activity People
removed_email_address@domain.invalid 
<mailto:removed_email_address@domain.invalid>

------------------------------------------------------------------------

*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.
This topic is locked and can not be replied to.