通过nginx配置实现静态文件下载(不需后台代码)

nginx配置:

server {
    listen 8123;
    server_name  localhost;
    charset utf-8;
    root    F:\myftp;
    location / {
        default_type  'application/octet-stream';
        add_header Content-disposition "attachment";
     }
 }

然后在浏览器里打开文件就可以了,在IE/Firefox/Chrome浏览器里测试通过。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容