nginx简易文件服务器
location /download {
root /root/download/;
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){
add_header Content-Disposition: 'attachment;';
}
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
#allow 192.168.4.0/24; #允许4段的所有地址访问
#allow 192.168.5.0/24; #允许5段的所有地址访问
#deny all; #禁止全部