1.nginx配置文件添加配置
location /download {
root /data;
add_header Content-Disposition: "attachment";
add_header Content-Type application/octet-stream;
autoindex off; # 开启目录浏览功能
autoindex_exact_size off; # 关闭详细文件大小统计,让文件大小显示MB,GB单位,默认为b
autoindex_localtime on; # 开启以服务器本地时区显示文件修改日期
}