我刚刚在 Debian 上安装了原装 Varnish,正在测试它。它似乎运行良好,只是它没有加载“/images”文件夹中的任何内容。
通过 Lighttpd 工作:
example.com/images/rss_icons.gif
无法通过 Varnish 工作
example.com:6081/images/rss_icons.gif
日志(隐藏 IP)
15 SessionOpen c 0.0.0.0 62452
15 ReqStart c 0.0.0.0 62452 784321607
15 RxRequest c GET
15 RxURL c /images/rss_icons.gif
15 RxProtocol c HTTP/1.1
15 RxHeader c Host: 0.0.0.0:6080
15 RxHeader c User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
15 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
15 RxHeader c Accept-Language: en-US,en;q=0.5
15 RxHeader c Accept-Encoding: gzip, deflate
15 RxHeader c Connection: keep-alive
15 VCL_call c recv
15 VCL_return c lookup
15 VCL_call c hash
15 VCL_return c hash
15 Hit c 784321606
15 VCL_call c hit
15 VCL_return c deliver
15 Length c 345
15 VCL_call c deliver
15 VCL_return c deliver
15 TxProtocol c HTTP/1.1
15 TxStatus c 404
15 TxResponse c Not Found
15 TxHeader c Content-Type: text/html
15 TxHeader c Server: lighttpd/1.4.19
15 TxHeader c Content-Length: 345
15 TxHeader c Date: Sun, 13 Jan 2013 16:23:33 GMT
15 TxHeader c X-Varnish: 784321607 784321606
15 TxHeader c Age: 7
15 TxHeader c Via: 1.1 varnish
15 TxHeader c Connection: keep-alive
15 ReqEnd c 784321607 1358094213.560343742 1358094213.560402632 0.180203199 0.000025749 0.000033140
有什么想法或建议吗?
答案1
答案2
问题出在 lighttpd 配置文件之一中的默认行:
$HTTP["remoteip"] =~ "127.0.0.1" {
alias.url += (
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
$HTTP["url"] =~ "^/doc/|^/images/" {
dir-listing.activate = "enable"
}
}
删除它之后,一切就好了!