简体   繁体   English

Facebook无法抓取我的安全网址(Nginx)

[英]Facebook not able to scrape my secured url (Nginx)

I have a Node.js app running on a Ubuntu server, with an SSL configured Nginx setup using Let's Encrypt. 我有一个在Ubuntu服务器上运行的Node.js应用程序,并使用Let's Encrypt进行了SSL配置的Nginx设置。

My Nginx config file looks like this: 我的Nginx配置文件如下所示:

server {

server_name www.example.be example.be;
location / {
        proxy_pass http://localhost:3485;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.be/fullchain.pem; # managed by C$
ssl_certificate_key /etc/letsencrypt/live/example.be/privkey.pem; # managed by$
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
   if ($host = www.example.be) {
      return 301 https://$host$request_uri;
   } # managed by Certbot


   if ($host = example.be) {
      return 301 https://$host$request_uri;
   } # managed by Certbot


   listen 80;
   server_name www.example.be example.be;
   return 404; # managed by Certbot
}

Without SSL, Facebook is perfectly able to scrape my url, but when I activate SSL and then submit it in the Facebook Sharing Debugger, I get following errors: 没有SSL,Facebook完全能够抓取我的网址,但是当我激活SSL并在Facebook Sharing Debugger中提交它时,出现以下错误:

Could Not Follow Redirect : URL requested a HTTP redirect, but it could not be followed. 无法跟随重定向:URL请求了HTTP重定向,但是无法遵循。

Circular Redirect : We could not resolve the canonical URL because the redirect path contained a cycle. 循环重定向:由于重定向路径包含一个循环,因此我们无法解析规范的URL。

Redirect Path 重定向路径

Input URL -> https://www.example.be 输入URL-> https://www.example.be

301 HTTP Redirect -> https://www.example.be 301 HTTP重定向-> https://www.example.be

Also, I have exactly the same problem with Google's PageSpeed insights. 另外,我对Google的PageSpeed见解也有完全相同的问题。 The error I'm getting there is "Attempting to load page reached the limit of 10 redirects" 我到达那里的错误是“尝试加载页面达到10个重定向的限制”

Thanks for any suggestions! 感谢您的任何建议!

将https强制重定向到此

if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM