计算机网络/计算机科学与应用/系统/运维/开发

精通Nginx 配置允许sendfile方式传输文件

相关指令 sendfile 和sendfile_max_chunk 


语法:

sendfile on | off;

用于开启或者关闭使用sendfile()传输文件,默认值为off,可以在http块、server块或者location块中进行配置


sendfile_max_chunk size;

size值如果大于0,Nginx进程的每个worker process每次调用sendfile()传输的数据量最大不能超过这个值

如果设置为0,则无限制,默认值为0

该指令可以在http块、server块或location块中配置


sendfile_max_chunk 128k;


微信小程序 https://www.javascriptcn.com/interview-weixinapp/677f48463d78df11d950b260.html

评论

^