04月 7th, 2008 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
标签:squid 防盗链
本站原创作品采用知识共享署名-相同方式共享 3.0 许可协议进行许可。
转载请注明 作者:xiao H,出处:linuxbyte.org ,原始链接:squid2.6下的防盗链设置
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
我来说两句