squid2.6下的防盗链设置

2008-04-07 xiao H Posted in 服务器应用

 盗链是很多站长头痛的问题,这里给出我做过的一个squid2.6防盗链解决办法。

#文件防盗链
acl legalreferer referer_regex ^http://www.linuxbyte.org ^http://[a-z].*\.linuxbyte\.org (受保护的站点和允许的域名)
acl fileurl url_regex -i \.rar$ \.zip$ \.iso$ \.bmp$ \.png$ \.gif$ \.jpg$  \.jpeg$ (受保护的文件名后缀)
http_access deny !legalreferer fileurl

#对多媒体文件的防盗链,能让播放器在线播放,但不能盗链.
acl legalplayer browser -i  ^windows-media-player  ^RealMedia  ^Mozilla ^foobar2000 ^nsplayer ^contype$ ^rma
acl mfurl url_regex -i \.wma$ \.wmv$ \.mp3$ \.mp4$ \.flv$ \.avi$ \.asf$ \.mpg$ \.mpeg$ \.rmvb$ \.rm$
http_access allow legalplayer mfurl
http_access deny !legalreferer mfurl





标签:

还没有评论呢。

我来说两句

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">