Та же фигня, которая в прошлом посте, но теперь средствами nginx
location ~* ^\/files\/([0-9]+)\/([0-9]+)\/(.*)\.(.*)$ {
set $ext $4;
root /path/to/docroot/;
if ($args ~ "name=(.*)"){
set $filename $1.$ext;
add_header Content-Disposition 'attachment; filename=$filename';
}
}