Lighttpd 1.5 cache有问题
今天测试了Lighttpd 1.5 with cache。用来与Tomcat 6进行结合,准备抛弃APACHE。
环境如下:
AS4
lighttpd 1.5 with cache
tomcat 6
但是出现了奇怪的问题,配置成功后第一次访问站点可以,但是第二次访问就报403 - Forbidden错误。看到文件已经被cache下来了。cache目录的权限看了一下也没有问题,文件也能读取,删除掉这个cache文件就好了。
我的配置如下:
cache.support-queries = "enable" #ignore '?' in url
cache.dynamic-mode = "enable"
cache.debug = "enable"
cache.bases = ("/cache") #write cached files in /data/cache directory
cache.refresh-pattern = (
"/$" => "5 update-on-refresh no-expire-header", # update homepage every 5 minutes and on refresh requests without setting expire headers
"\.(?i)(js|css|xml)$" => "240", # update js/css/xml every 4 hours and on refresh requests
"\.(?i)(htm|html|shtml)$" => "30", # update html/htm/shtml every 30 minutes and on refresh requests
"\.(?i)(jpg|bmp|jpeg|gif|png)$" => "2880", # update graphics files every 2 days
"\.(?i)(rar|zip|wmv|avi|mp3|ape|rm|mpeg|mpg|wma|asf|rmvb|mp4)$" => "0 fetchall-for-range-request", # cache media file forever
"\.(?i)(action)$" => "5" # update action request every 5 minutes
$HTTP["url"] =~ ".action|.do|.jsp|.vrf|request_ad_info.js|/js/dq/|/bfapp/|/js/monitor/|/editor/filemanager/" {
proxy-core.balancer = "round-robin"
proxy-core.protocol = "ajp13"
proxy-core.backends = ( "localhost:8009" )
proxy-core.max-pool-size = 16
proxy-core.worked-with-modcache = "enable"
}