我正在开发一个使用一些 Facebook 社交插件的项目,主要是评论框插件。开发服务器向公众开放,但设置了 auth_basic。是否可以为 Facebook 禁用此功能?当我显示评论框时,它说
“此网址无法访问”
我通过将 Facebook 的 IP 地址添加到 nginx 配置文件来做到这一点
satisfy any;
allow 66.220.144.0/20;
allow 66.220.144.0/21;
allow 66.220.152.0/21;
allow 66.220.159.0/24;
allow 69.63.176.0/20;
allow 69.63.176.0/21;
allow 69.63.176.0/24;
allow 69.63.178.0/24;
allow 69.63.184.0/21;
allow 69.171.224.0/19;
allow 69.171.224.0/20;
allow 69.171.239.0/24;
allow 69.171.240.0/20;
allow 69.171.255.0/24;
allow 74.119.76.0/22;
allow 103.4.96.0/22;
allow 173.252.64.0/18;
allow 173.252.64.0/19;
allow 173.252.70.0/24;
allow 173.252.96.0/19;
allow 204.15.20.0/22;
allow 31.13.24.0/21;
allow 31.13.64.0/18;
allow 31.13.64.0/19;
allow 31.13.64.0/24;
allow 31.13.65.0/24;
allow 31.13.66.0/24;
allow 31.13.67.0/24;
allow 31.13.68.0/24;
allow 31.13.69.0/24;
allow 31.13.70.0/24;
allow 31.13.71.0/24;
allow 31.13.72.0/24;
allow 31.13.73.0/24;
allow 31.13.74.0/24;
allow 31.13.75.0/24;
allow 31.13.76.0/24;
allow 31.13.77.0/24;
allow 31.13.78.0/24;
allow 31.13.79.0/24;
allow 31.13.80.0/24;
allow 31.13.81.0/24;
allow 31.13.82.0/24;
allow 31.13.83.0/24;
allow 31.13.84.0/24;
allow 31.13.85.0/24;
allow 31.13.86.0/24;
allow 31.13.87.0/24;
allow 31.13.88.0/24;
allow 31.13.89.0/24;
allow 31.13.90.0/24;
allow 31.13.91.0/24;
allow 31.13.92.0/24;
allow 31.13.93.0/24;
allow 31.13.94.0/24;
allow 31.13.95.0/24;
allow 31.13.96.0/19;
deny all;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
老问题,但我想是 gfood 来解释如何获取当前 IP。
Facebook 提供了一种获取他们使用的所有 IP 的方法:
whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
该命令返回他们使用的所有 IPv4 和 IPv6。获得 IP 后,将它们添加到您的服务器(Nginx、Apache 等)。
检查Facebook 爬虫页面。