万维当云伯乐 CDN华纳云
Nginx教程2026-07-159 阅读

Nginx屏蔽或禁止指定来源网站访问

本文摘要在nginx.conf的server配置项中加入1.nginx访问返回403if ($http_referer ~* "xxx.com") { return 403; }2.nginx访问跳转指定网站if ($http_referer ~* "xxx.com") { rewrit...
丽萨主机
AD:
【广告招商】文章正文文字广告位开放合作

在nginx.conf的server配置项中加入

1.nginx访问返回403

if ($http_referer ~* "xxx.com") {
      return 403;  }

2.nginx访问跳转指定网站

if ($http_referer ~* "xxx.com") {
rewrite ^/ http://www.xxx.com/;}

3.nginx禁止多域名

if ($http_referer ~* "xxx.com|aaa.com") {
rewrite ^/ http://www.xxx.com/;}
广告招商文章内容详情页下 · 优质席位开放中合作咨询
上一篇没有了
下一篇没有了