我有一个Apache服务器运行在与varnish服务器不同的主机上。如果我们点击apache服务器的ip,它会重定向到apache_ip/index.php/Main_Page。用apache后端缓存清漆重定向
由于这个Apache服务器是清漆的后端服务器,我总是从清漆得到301响应。
sh-4.3# curl 172.16.217.59 -v
* Rebuilt URL to: 172.16.217.59/
* Trying 172.16.217.59...
* TCP_NODELAY set
* Connected to 172.16.217.59 (172.16.217.59) port 80 (#0)
> GET/HTTP/1.1
> Host: 172.16.217.59
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Thu, 17 Aug 2017 18:00:03 GMT
< Server: Apache/2.4.27 (Debian)
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding,Cookie
< Cache-Control: s-maxage=1200, must-revalidate, max-age=0
< Last-Modified: Thu, 17 Aug 2017 18:00:03 GMT
< Location: http://172.16.217.173/index.php/Main_Page
< Content-Length: 0
< Content-Type: text/html; charset=utf-8
< X-Varnish: 32789 32787
< Age: 1003
< Via: 1.1 varnish (Varnish/5.0)
< Connection: keep-alive
<
* Curl_http_done: called premature == 0
* Connection #0 to host 172.16.217.59 left intact
如何配置清漆服务器来处理此重定向?我希望转到重定向位置并缓存其内容。
这不起作用。我得到了相同的响应头 –
@ShivamMitra我仍然认为最好的方法是使用主机名,这将节省您与VCL上的规则混乱的头痛,但你应该能够解决我的拉丁编辑问题 –