server {
listen 9999;
server_name localhost;
add_header Content-Disposition 'attachment';
location / {
root D:/xxx;
index index.html index.htm;
try_files $uri /index.html;
autoindex on;
}
}
主要实现功能为这一行 让浏览器直接下载
add_header Content-Disposition 'attachment';