nginx配置访问文件目录
location /zzy{
alias /usr/zzy; #设置访问文件目录
autoindex on; #自动索引
autoindex_exact_size off; #使得文件大小以MB,GB形式显示而非KB
autoindex_localtime on; #使用本地时间
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){
add_header Content-Disposition attachment;
add_header Content-Type application/octet-stream;
}
#使得上述.后缀的文件可以下载
}