Skip to content

Instantly share code, notes, and snippets.

@lazyjerry
Created November 10, 2023 10:28
Show Gist options
  • Save lazyjerry/338e48bbee2420e037186b4a62303ae0 to your computer and use it in GitHub Desktop.
Save lazyjerry/338e48bbee2420e037186b4a62303ae0 to your computer and use it in GitHub Desktop.
location ^~ /downloads/ {
add_header Content-Disposition attachment;
add_header Content-Type application/octet-stream;
sendfile on; # 开启高效文件传输模式
autoindex on; # 开启目录文件列表
autoindex_exact_size on; # 显示出文件的确切大小,单位是bytes
autoindex_localtime on; # 显示的文件时间为文件的服务器时间
charset utf-8,gbk; # 避免中文乱码
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment