只能用
loacation ~ ^/down/(.)${
root "D:/downloadfile;"
set $file_url $1;
if ($query_string ~ ^(.)action=down\b|download\b(.)$ ){
add_header Content-Disposition "attachment; filename=$1";
}
}
charset utf-8;
不能直接用
set $file_url $1;
if ($query_string ~ ^(.)action=down\b|download\b(.*)$ ){
add_header Content-Disposition "attachment; filename=$1";
}