【发布时间】:2018-01-26 07:46:20
【问题描述】:
我有一个 apache 服务器在与清漆服务器不同的主机上运行。如果我们点击 apache 服务器的 ip,它会重定向到 apache_ip/index.php/Main_Page。
由于这个 apache 服务器是 varnish 的后端服务器,我总是从 varnish 收到 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
如何配置清漆服务器来处理这个重定向?我希望转到重定向位置并缓存其内容。
【问题讨论】: