在nginx.conf文件中加入下面代码
location / {
if ($request_filename ~* ^.*?\.(html|doc|pdf|zip|docx)$) {
add_header Content-Disposition attachment;
add_header Content-Type application/octet-stream;
}
}
标签:文件,header,Content,nginx,add,PDF,下载
From: https://www.cnblogs.com/d-d-g/p/16917538.html