我对Debian进行了清漆。
我在http://example.com上有一个在Apache上运行的网站
这是我的/etc/varnish/default
vcl 4.0;
backend default {
.host = "example.com";
.port = "8080";
}清漆开始,我可以在http://127.0.0.1:6081/上看到网站的内容
响应头:
Pragma: no-cache
Date: Tue, 25 Aug 2015 12:29:38 GMT
Content-Encoding: gzip
Server: Apache/2.4.10 (Ubuntu)
Age: 0
X-Powered-By: PHP/5.6.4-4ubuntu6.2
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Via: 1.1 varnish-v4
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
X-Varnish: 229436
Connection: keep-alive
Accept-Ranges: bytes
Content-Length: 23044
Expires: Thu, 19 Nov 1981 08:52:00 GMT
200 OK如何在http://example.com下使其可见?如何配置Varnish和Apache?
发布于 2015-08-25 13:45:48
在/etc/ vhost文件中,在127.0.0.1IP上添加example.com和任何其他vhost名称。当清漆访问"example.com“时,它将被解析为127.0.0.1,但是正确的主机名头将跟随对apache的请求,后者将能够将其映射到正确的vhost。在apache中不应该需要特殊的配置,也不需要清漆,只需在apache中正常配置vhost即可。
https://serverfault.com/questions/716606
复制相似问题