-
26-12-2019 - |
题
我的rarnish安装了我的apache web服务器上的默认设置。Apache列出到端口8080和清单列表到80。
我在网站上有很少的可下载文件,大小为100MB,500MB和1GB
1GB不起作用,当您单击它时,它将说不可用的页面或连接通过服务器关闭。另外两个工作正常,但我不确定这是下载它们的正确方法。
如何使rannish绕过这些文件并直接从Web服务器获取它们?
谢谢。
解决方案
这可以通过检查后端答案中的Content-Length
进行检查,如果大于某种大小,则将其标记为某些标记和生成扫描码请求事务
示例,具有Content-Length>= 10,000,00的文件应该是管道:
sub vcl_fetch {
..
if ( beresp.http.Content-Length ~ "[0-9]{8,}" ) {
set req.http.x-pipe-mark = "1";
return(restart);
}
..
}
.
然后我们返回检查请求接收和解析。
在这里,我们可以检查我们的标记并执行restart
sub vcl_recv {
..
if (req.http.x-pipe-mark && req.restarts > 0) {
return(pipe);
}
..
}
. 其他提示
In varnish 4, vcl_fetch should be replaced with vcl_backend_response, see https://www.varnish-cache.org/docs/trunk/whats-new/upgrade-4.0.html
不隶属于 StackOverflow