location / {
valid_referers none 192.168.28.70;
if ($invalid_referer) {
return 403;
}
root html;
index index.html index.htm;
}
测试:
curl -e "http://192.168.28.70" -I http://192.168.28.70/1.jpeg
curl -e "http://192.168.28.100" -I http://192.168.28.70/1.jpeg
curl -I http://192.168.28.70/1.jpeg
转载请注明:SuperIT » nginx防盗链设置