- if ($request_filename ~* ^.*?\.(txt|mp4|mp3|mov|acc|m4a|rar|zip)$)
- {
- add_header Content-type 'application/octet-stream;';
- add_header Accept-Ranges 'bytes;';
- add_header Content-Disposition 'attachment;';
- }
来源: http://www.bubuko.com/infodetail-2111570.html