在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)