Welcome! Log In Create A New Profile

Advanced

Serving Static Files

June 08, 2009 05:32AM
Hello everyone. I've been using nginx for a while now but haven't scratched the surface, just used recommended options.

I decided I needed to know more about it, so here I am.

In the main http module nginx.conf file there are these lines

include /etc/nginx/mime.types;
default_type application/octet-stream;

I assumed what they meant is that if a client tries to download a file that is described in the mime.types file, then nginx will handle that download for me.

In one of our server blocks I've noticed that another developer has a location block like this

location ~* ^.+\.(docx|pdf|mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|txt|tar|mid|midi|wav|rtf|mpeg|jpg|jpeg|gi
f|png|ico|css|bmp|js)$ {
root /var/django/django_projects/glamlifenews;
limit_rate 2000K;
access_log /var/django/conf/log/glamlifenews_nginx_django_media.log download;
access_log off;
}

Would I be right in assuming that what would happen here is that in this particular website nginx would still handle the download, but the extra options are there to handle logging the downloads for this particular app, setting the limit_rate and giving a specific place to download the files from?

Would this also speed up the download process?

Any help, greatly appreciated.
Subject Author Posted

Serving Static Files

vanderkerkoff June 08, 2009 05:32AM

Re: Serving Static Files

bernard.barbosa September 24, 2009 03:43AM

Re: Serving Static Files

Igor Sysoev September 24, 2009 06:12AM

Re: Serving Static Files

bernard.barbosa September 25, 2009 02:30AM

Re: Serving Static Files

Igor Sysoev September 25, 2009 04:58AM

Re: Serving Static Files

bernard.barbosa September 25, 2009 05:12AM

Re: Serving Static Files

bernard.barbosa September 25, 2009 05:19AM

Re: Serving Static Files

Igor Sysoev September 25, 2009 05:30AM

Re: Serving Static Files

Igor Sysoev September 25, 2009 05:34AM

Re: Serving Static Files

bernard.barbosa September 27, 2009 11:52PM

Re: Serving Static Files

bernard.barbosa September 27, 2009 11:54PM

Re: Serving Static Files

bernard.barbosa September 29, 2009 05:11AM

Re: Serving Static Files

bernard.barbosa October 04, 2009 11:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 200
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready