反向代理被阻止

反向代理被阻止

我遇到过这样的情况:我的域名叫 zzzz.com,转发到 xxxx.com,但是收到 Cloudflare 的错误信息“403 Forbidden cloudflare”。错误来自 xxxx.com。下面是我的定义

location / {
proxy_cookie_domain https://www.xxxx.com https://www.zzzz.com;
proxy_set_header Accept-Encoding "";
proxy_set_header Host xxxx.com;
proxy_pass https://xxxx.com;
proxy_redirect https://xxxx.com https://zzzz.com;
subs_filter_types text/css text/javascript application/javascript;
subs_filter "https://(.*).xxxx.com/(.*)" "https://zzzz.com/$1/$2" gi;
subs_filter "https://xxxx.com" "https://zzzz.com" gi;
subs_filter "https://www.xxxx.com" "https://zzzz.com" gi;
subs_filter "www.xxxx.com" "zzzz.com" gi;
subs_filter "xxxx.com" "zzzz.com" gi;
}

我做错了什么?为什么 cloudflare 屏蔽了我?

答案1

这修复了它:

proxy_ssl_server_name on;
proxy_ssl_name $proxy_host;

相关内容