首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 互联网 >

nginx配置xsendfile提升文件上载性能

2012-10-20 
nginx配置xsendfile提升文件下载性能之前看到了robbin发表的lighttpd x-sendfile的相关文章,感到很实用,而

nginx配置xsendfile提升文件下载性能
之前看到了robbin发表的lighttpd x-sendfile的相关文章,感到很实用,而我现在用的是nginx,
于是乎,开始找了一些nginx and x-sendfile的文章,组织和实践一下和大家分享:

NginxXSendfile

发送静态文件使用的是一个叫做X-sendfile的header特性.
nginx当然也有这个特性,但是实现的略微不同,在nginx中叫做X-Accel-Redirect.

有两个特性需要阐述:
1.header 中必须包括URI
2.本地必须声明为 internal,用于内部redirect和X-Accel-Redirect responses。

配置例子:

X-Accel-Limit-Rate: 1024X-Accel-Buffering: yes|noX-Accel-Charset: utf-8


热点排行