Welcome! Log In Create A New Profile

Advanced

Don't understand why this directive causes a 404 in mp3 only

Doc
March 29, 2014 12:52PM
On my site, music can be played by going to
http://mysite.com/music/billyjoel/song.mp3 (for example).
You can download the same song by going to
http://mysite.com/music/billyjoel/download/song.mp3.

The path including "download" is aliased and the default mime type
changed as shown here:

location /music/billyjoel/play/ {
types{
audio/mp3 mp3;
}
}

location /music/billyjoel/download/ {
types{}
default_type application/octet-stream;
alias /(location of root goes here)/music/billyjoel/play/;
}

This works as intended. However, I set expires and access_log directives
for css/jpg/woff, etc. like this and the mp3 will no longer download and
I get a 404 with a "file not found" error in the error logs:

location ~* ^.+\.(mp3|jpg|css)$ {
expires modified +30d;
access_log off;
}
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Don't understand why this directive causes a 404 in mp3 only

Doc March 29, 2014 12:52PM

Re: Don't understand why this directive causes a 404 in mp3 only

Adie Nurahmadie March 29, 2014 01:14PM

Re: Don't understand why this directive causes a 404 in mp3 only

Doc March 29, 2014 02:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 171
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready