I try to set max-age header directive and Content-Disposition "attachment" as follows:
location / {
# set up max-age header directive for certain file types for proper caching
location ~* \.(?:css|js|ico|gif|jpe?g|png|mp3|mpeg|wav|x-ms-wmv|eot|svg|ttf|woff|woff2)$ {
expires 7d;
add_header Cache-Control "public";
}
# force download for ceratain file types
location ~* \.(?:fb2|mobi|mp3)$ {
add_header Content-Disposition "attachment";
}
...
}
The problem is with the .mp3 files with match both location blocks. Only the first one is used (max-age). How can I have .mp3 with both - max-age and Content-Disposition "attachment"?