location ~^/map {
# alias /usr/local/hbyck/map/;
root /usr/local/hbyck;
index index.html index.htm;
autoindex on; # 开启目录文件列表
autoindex_exact_size off; # 显示出文件的确切大小,单位是bytes
autoindex_localtime on; # 显示的文件时间为文件的服务器时间
charset utf-8,gbk; # 避免中文乱码
if ($request_filename ~* ^.*?\.(txt|doc|pdf)$){
add_header Content-Disposition: 'attachment';
add_header Content-Type application/octet-stream;
}
nginx 配置下载本地文件服务
最新推荐文章于 2024-03-27 18:27:03 发布