Finally, Sinaimg.cn has started the security chain, and the free Sina map bed has started the security chain. What can we do now? A large number of Sina pictures are used Outer chain Our webmaster friends want to die. Do you really want to localize the pictures in the external chain? But broadband can't bear it. Don't panic. There are policies and countermeasures. Let's see how we can fight against piracy.
1. The simplest and most effective way
Add a line of configuration in the website configuration file: add_header Referrer-Policy "no-referrer";
PS: Of course, you can also directly click<head>in the global header file of the website</ Add this code between the head>to achieve the same effect: <meta name="referrer" content="same-origin"> <meta name="referrer" content="no-referrer">
This configuration means to remove the entire referer header. Access source information is not sent with the request. In short, let Sina think that I directly input the complete image address to open this image, rather than opening it from someone else's website.
advantage : Fast and efficient.
shortcoming : This method will cause the third-party statistics code to become invalid, and the advertising alliance code to become invalid.
2. Advanced solutions
At present, the domain names that have been downloaded to Sina's map bed have successively opened the anti leech measures: ww1.sinaimg.cn, ww2.sinaimg.cn, ww3.sinaimg.cn, ww4.sinaimg.cn, ws1.sinaimg.cn, ws2.sinaimg.cn, ws3.sinaimg.cn, ws4.sinaimg.cn, wx1.sinaimg.cn, wx2.sinaimg.cn, wx3.sinaimg.cn, wx4.sinaimg.cn, wx4.sinaimg.cn.
You can take the database (phpmyadmin) and directly replace these domain names in batches as any of the domain names you have already assigned: tva1.sinaimg.cn, tva2.sinaimg.cn, tva3.sinaimg.cn, tva3.sinaimg.cn, tvax4.sinaimg.cn, tvax4.sinaimg.cn, tvax4.sinaimg.cn, tvax4.sinaimg.cn, tvax4.sinaimg.cn, tvax4.sinaimg.cn.
advantage : No side effects.
shortcoming : The operation process is relatively complicated.
3. Reverse proxy Sina map bed domain name
If you have changed the domain name to tva1.sinaimg.cn in the second method, you can directly add the reverse proxy target url to the server: http://tva1.sinaimg.cn
4、 Black technology
I accidentally found a very interesting black technology. Sinaimg.in also has a domain name: sinaimg.in. This domain name is a bit slow to open when parsing to overseas servers. You can customize the secondary domain name at will, but does not support https encrypted addresses.
The address of this picture is as follows
http://dsda3.sinaimg.in/large/4c929964ly1g1bajefa7hj20rs13kte4.jpg
But any of the following picture links can be opened
http://wrwerw6erw.sinaimg.in/large/4c929964ly1g1bajefa7hj20rs13kte4.jpg
http://mnmg3hjtyd.sinaimg.in/large/4c929964ly1g1bajefa7hj20rs13kte4.jpg