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

Doc icantthinkofone at charter.net
Sat Mar 29 16:50:09 UTC 2014


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;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140329/a79f8018/attachment.html>


More information about the nginx mailing list