繁体   English   中英

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

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

我有一个在Ubuntu服务器上运行的Node.js应用程序,并使用Let's Encrypt进行了SSL配置的Nginx设置。

我的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
}

没有SSL,Facebook完全能够抓取我的网址,但是当我激活SSL并在Facebook Sharing Debugger中提交它时,出现以下错误:

无法跟随重定向:URL请求了HTTP重定向,但是无法遵循。

循环重定向:由于重定向路径包含一个循环,因此我们无法解析规范的URL。

重定向路径

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

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

另外,我对Google的PageSpeed见解也有完全相同的问题。 我到达那里的错误是“尝试加载页面达到10个重定向的限制”

感谢您的任何建议!

将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