在nginx.conf的server配置项中加入
1.访问返回403
if ($http_referer ~* "xxx.com") {
return 403;
}
2.访问跳转指定网站
if ($http_referer ~* "xxx.com") {
rewrite ^/ http://www.xxx.com/;
}
3.禁止多域名
if ($http_referer ~* "xxx.com|aaa.com") {
rewrite ^/ http://www.xxx.com/;
}
------本页内容已结束,喜欢请分享------
感谢您的来访,获取更多精彩文章请收藏本站。
评论(1)
不错,可以防止反代~