一、利用ngx_http_referer_module模块【默认安装】
# 文件扩展
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
valid_referers none blocked *.17fa.online;
if ($invalid_referer) {
return 403;
#rewrite ^/ https://www.baidu.com/img/xinshouyedong_4f93b2577f07c164ae8efa0412dd6808.gif;
}
expires 30d;
}
# 目录
location /upload {
valid_referers none blocked *.17fa.online;
if ($invalid_referer) {
return 403;
}
}
二、利用ngx_http_accesskey_module模块
包下载损坏