【发布时间】:2019-01-14 15:38:59
【问题描述】:
如何配置 varnish(或者如果有人可以提示我使用 squid 我很好)来缓存来自后端的请求,但通过 http_proxy 连接到后端
所以我尝试:
backend default {
.host = "10.1.1.1";
.port = "8080";
}
backend corp_proxy {
.host = "proxy";
.port = "8080";
}
sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don't need,
# rewriting the request, etc.
set req.backend_hint = corp_proxy;
set req.url ="http://" + req.http.host + req.url;
}
【问题讨论】:
-
这是我认为的正确方法,你能告诉我有什么问题吗?
标签: reverse-proxy varnish squid