Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Facebook无法抓取我的安全url(Nginx)_Node.js_Facebook_Ssl_Nginx_Lets Encrypt - Fatal编程技术网

Node.js Facebook无法抓取我的安全url(Nginx)

Node.js Facebook无法抓取我的安全url(Nginx),node.js,facebook,ssl,nginx,lets-encrypt,Node.js,Facebook,Ssl,Nginx,Lets Encrypt,我有一个Node.js应用程序运行在Ubuntu服务器上,使用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

我有一个Node.js应用程序运行在Ubuntu服务器上,使用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完全可以抓取我的url,但当我激活SSL并在Facebook共享调试器中提交它时,我会出现以下错误:

无法跟随重定向:URL请求了HTTP重定向,但无法跟随

循环重定向:我们无法解析规范URL,因为重定向路径包含循环

重定向路径

输入URL->

301 HTTP重定向->

另外,我对谷歌的PageSpeed insights也有同样的问题。我遇到的错误是“尝试加载页面已达到10个重定向的限制”


谢谢你的建议

将https强制重定向更改为此

if($http\u x\u forwarded\u proto=“http”){返回301 https://$host$request\u uri;}