【发布时间】:2015-09-04 09:47:46
【问题描述】:
我已将 varnish 4 设置为在端口 8081 上运行,而 apache 配置为在端口 80 上运行。
我的设置的问题是当我浏览我的域时
http//:mydomain.com:8180/.
我得到一个 (301) 永久重定向到 http//:mydomain.com/。
由于此重定向,我无法区分调用缓存域 http//:mydomain.com:8180/ visa 与未缓存域 http//:mydomain.com/ 之间的区别。
我的清漆配置
DAEMON_OPTS="-a :8180\
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,1G"
.......
也是vcl
backend mydomain {
.host = "x.x.x.x";
.port = "80";
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
.max_connections = 800;
}
.......
响应头显示 apache 是重定向的。
HTTP/1.1 301 Moved Permanently
Date: Fri, 04 Sep 2015 11:58:04 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
X-Pingback: http//:mydomain.com/xmlrpc.php
Location: http//:mydomain.com/
Vary: Accept-Encoding
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Varnish: 32795
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive
我的问题是如何停止重定向?
【问题讨论】: