实现方法

  1. 禁止指定网站来访
    if ($http_referer ~* "要拦截的域名") {
        return 301 要跳转的域名;
    }
    • 将上述代码添加到网站的Nginx配置文件中,保存并提交。