如果你在NGINX上运行,你需要做的就是打开你的配置文件并添加以下内容:
location ~ .(gif|png|jpeg|jpg|svg)$ { valid_referers none blocked ~.google. ~.bing. ~.yahoo. yourdomain.com *.yourdomain.com; if ($invalid_referer) { return 403; } }
原文链接:https://c.larjie.com/enable-hotlink-protection-on-nginx/,转载请注明出处。