[英]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.