In general, the anti-theft chain is for software downloads and pictures, because the general site does not provide resources to download, so this article is mainly for the image of the anti-theft chain
1, if the whole station picture to do anti-theft chain, at least need an additional domain name to store pointing to the picture. Because if the whole station pictures do a chain of anti-theft, including hotlinking hint picture of all the pictures can not be displayed.
Such cases modify the/usr/local/nginx/conf/nginx.conf file
2, the individual domain name configuration picture anti-theft chain, personal comparison recommendation, one is easy to control, second, you can re-create a domain name on the same server used to store hotlinking hint pictures.
This kind of situation modifies/usr/local/nginx/conf/vhost/your own domain name. conf file
3, you need to prepare a hotlinking hint picture, put on other servers or other domain name (picture you do it, not provided here)
4, found in the configuration file similar to the following location...jpg ... This code, and then change it, I slowly explain
Location ~. *\. (gif|jpg|jpeg|png|bmp|swf) $
{
Expires 30d;
Access_log off;
Valid_referers None blocked *.slyar.com *.jetfond.com *.youdao.com *.zhuaxia.com *.xianguo.com *.google.cn *.google.com *.google.com.tw *.google.com.sg *.google.com.hk *.bloglines.com image.soso.com bing.com cn.bing.com image.baidu.com *. FeedBurner.com *.feedsky.com;
if ($invalid _referer)
{
Rewrite ^/http://kvm.slyar.com/slyar_hotlinking.png;
}
}
Expires 30d; Client cache time, unrelated hotlinking
Access_log off; Do not log picture access logs, unrelated hotlinking
Valid_referers None blocked ...//allow access to the site of the picture, blocked supports prefix wildcard characters. None need to explain, if you do not know what HTTP refer is, then do not know, if you know, then this none means matching no refer access, popular point is directly with the URL to access, here I write to express permission, You can delete this parameter if you do not allow to see the image directly in the image address.
Rewrite ^/http://kvm.slyar.com/slyar_hotlinking.png; Hotlinking request to jump to a picture or a page, casually
5.: Wq Save exit
6. Reload nginx config file, done
/etc/init.d/nginx Reload
Nginx modified configuration Implementation Picture anti-theft chain