I saw a friend asking in QQ group yesterdayLNMPIn fact, the military brother has already answered the question about how to prevent chains from being stolen in the environment. Here I will share it with you and take a note at the same time.
Since nginx does not support. htaccess, it is impractical to prevent it directly from this aspect. We need to modify the configuration file to solve this problem.
First, we find the conf file of the domain name that needs the anti leech. The path is/usr/local/nginx/conf/vhost/, such as zrblog.net.conf
It's better to back it up first, so as not to make mistakes and directly cover it back. This is a good habit!!!
Please revise the above content according to your own situation. I will give you a basic explanation here.
The first line gif | jpg | jpeg | png... These are the file types you need to prevent piracy. You can add some suffix types;
The third line is the domain name of your website, that is, the domain name released. If there are multiple domains, please add them, and pay attention to the blank space;
The fifth line is the picture seen by the pirate chain. A 404.jpg is returned. The source address of the picture must be able to be linked outside. Otherwise, the picture seen by others is just a XX.
After that, save it, upload it to the original location, and then restart lnmp to make it effective.
/root/lnmp restart
In addition, a friend asked how to prevent collection. It seems that there is no particularly effective method for this problem at present. It is suggested that you can study it from the system level, such as the limitation of iptables rules.