我已经使用Facebook共享调试器在网站上突出显示了一个问题
URL requested a HTTP redirect, but it could not be followed.
https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fwww.badgerbookings.com
我已经研究并确保添加所有OG元标记。我还“减少”了nginx上的重定向,使其仅支持http> https重定向,这对我来说似乎很标准。
它仍然在调试器和隐私策略URL上均产生错误。
我的Nginx配置:
server_tokens off; #Enables or disables emitting nginx version on error pages and in the “Server” response header field
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
return 301 https://www.badgerbookings.com$request_uri;
}
server {
server_name www.badgerbookings.com badgerbookings.com *.badgerbookings.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # allow websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP
proxy_set_header Host $http_host;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/badgerbookings.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/badgerbookings.com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
答案 0 :(得分:2)
转到Facebook Developer's policy页。
向下滚动到该位:
隐私权政策
a。提供公开可用且易于访问的隐私权政策 解释您正在收集什么数据以及如何使用它们 数据。
现在运行
curl https://badgerbookings.com/terms
您是否正在查看该网址公开提供的易于访问的隐私政策?
答案 1 :(得分:0)
您可能遇到IPv6问题,只需在SSL listen [::]:443 ssl
块中添加server
指令即可解决。
如果仍不能解决问题,请尝试使用匹配的if
指令进行重定向
if ($scheme != "https") {
return 301 https://www.badgerbookings.com$request_uri
}
如果将两个服务器块合并为一个,最好避免使用更多代码。只需删除一个非https的端口,并在另一个端口上插入端口80的监听指令,通过该条件重定向,这样您的代码将更加苗条。