添加如下配置即可:
使用alias 关键字 必须带/
location ~ ^/down/{
alias /www/wwwroot/download/;//自己服务器所在目录 需要存在
autoindex on; # 开启目录文件列表
autoindex_exact_size on; # 显示出文件的确切大小,单位是bytes
autoindex_localtime on; # 显示的文件时间为文件的服务器时间
charset utf-8,gbk; # 避免中文乱码
}