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

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

On my site, music can be played by going to (for example).
You can download the same song by going to

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

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

location /music/billyjoel/download/ {
     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: <>

More information about the nginx mailing list