# Force files in /scripts to download instead of display! location ~ ^/scripts/(?P[^/]+)$ { add_header Content-Disposition "attachment; filename=$request_basename"; } location ~ ^.*/(?P[^/]+\.(mp3))$ { root /path/to/mp3/ add_header Content-Disposition 'attachment; filename="$request_basename"'; }