Varnish 端口重定向至 80

Varnish 端口重定向至 80

在端口 8888 上运行 varnish 进行测试,在端口 80 上运行 apache,但当我输入 [url]:8888 时,它一直重定向到 [url]。varnishlog 也显示了重定向。我认为 wordpress 可能导致了重定向,但我已经检查并清理了 htaccess 以及一些 seo 插件。我是否遗漏了什么?

   13 SessionOpen  c [client ip] 49990 :8888
   13 ReqStart     c [client ip] 49990 1274576456
   13 RxRequest    c GET
   13 RxURL        c [url]
   13 RxProtocol   c HTTP/1.1
   13 RxHeader     c Host: [domain]:8888
   13 RxHeader     c Connection: keep-alive
   13 RxHeader     c Cache-Control: max-age=0
   13 RxHeader     c User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
   13 RxHeader     c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   13 RxHeader     c Accept-Encoding: gzip,deflate,sdch
   13 RxHeader     c Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
   13 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   13 RxHeader     c Cookie: __gads=ID=68af3a0e2bc4d2ba:T=1342510622:S=ALNI_MYQGA3VsF3DzTP3PgwRrM_WohvZ3A; wpgb_visit_last_php-http://www_google_co_uk=1343054097; wpgb_visit_last_php-http://sg_search_yahoo_com=1343284074; wordpress_test_cookie=WP+Cookie+check; wpgb_logged_in=
   13 VCL_call     c recv pass
   13 VCL_call     c hash
   13 Hash         c [url]
   13 Hash         c [domain]:8888
   13 VCL_return   c hash
   13 VCL_call     c pass pass
   13 Backend      c 14 default default
   13 TTL          c 1274576456 RFC 0 -1 -1 1343377151 0 1343377150 442645200 0
   13 VCL_call     c fetch
   13 TTL          c 1274576456 VCL 120 -1 -1 1343377150 -0
   13 VCL_return   c hit_for_pass
   13 ObjProtocol  c HTTP/1.1
   13 ObjResponse  c Moved Permanently
   13 ObjHeader    c Date: Fri, 27 Jul 2012 08:19:10 GMT
   13 ObjHeader    c Server: Apache
   13 ObjHeader    c X-Powered-By: PHP/5.3.14
   13 ObjHeader    c Expires: Wed, 11 Jan 1984 05:00:00 GMT
   13 ObjHeader    c Last-Modified: Fri, 27 Jul 2012 08:19:10 GMT
   13 ObjHeader    c Cache-Control: no-cache, must-revalidate, max-age=0
   13 ObjHeader    c Pragma: no-cache
   13 ObjHeader    c X-Pingback: http://[domain]/xmlrpc.php
   13 ObjHeader    c Content-Length: 0
   13 ObjHeader    c Content-Type: text/html; charset=UTF-8
   13 ObjHeader    c Location: [url]
   13 VCL_call     c deliver deliver
   13 TxProtocol   c HTTP/1.1
   13 TxStatus     c 301
   13 TxResponse   c Moved Permanently
   13 TxHeader     c Server: Apache
   13 TxHeader     c X-Powered-By: PHP/5.3.14
   13 TxHeader     c Expires: Wed, 11 Jan 1984 05:00:00 GMT
   13 TxHeader     c Last-Modified: Fri, 27 Jul 2012 08:19:10 GMT
   13 TxHeader     c Cache-Control: no-cache, must-revalidate, max-age=0
   13 TxHeader     c Pragma: no-cache
   13 TxHeader     c X-Pingback: http://[domain]/xmlrpc.php
   13 TxHeader     c Content-Type: text/html; charset=UTF-8
   13 TxHeader     c Location: [url]
   13 TxHeader     c Content-Length: 0
   13 TxHeader     c Accept-Ranges: bytes
   13 TxHeader     c Date: Fri, 27 Jul 2012 08:19:10 GMT
   13 TxHeader     c X-Varnish: 1274576456
   13 TxHeader     c Age: 0
   13 TxHeader     c Via: 1.1 varnish
   13 TxHeader     c Connection: keep-alive
   13 TxHeader     c X-Cache: MISS
   13 Length       c 0
   13 ReqEnd       c 1274576456 1343377150.415471554 1343377150.618368387 0.000094175 0.202822208 0.000074625
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1343377151 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1343377154 1.0
   13 Debug        c herding
   13 SessionClose c timeout
   13 StatSess     c [client ip] 49990 0 1 1 0 1 1 609 0

答案1

它是由 Wordpress wpurl(或一些其他基本 url 设置)引起的。

重定向由 Location 标头(13 TxHeader c Location: [url])进行,而不是由 Varnish 自身进行。

相关内容