facebook meta og:帖子中未显示图像

问题描述 投票:0回答:1

我有以下元标记

<meta data-n-head="true" data-hid="og-title" property="og:title" content=" | Skryit"><meta data-n-head="true" data-hid="og-description" property="og:description" content="">
<meta data-n-head="true" data-hid="og-type" property="og:type" content="website">
<meta data-n-head="true" data-hid="og-url" property="og:url" content="https://www.skryit.com/vonawesome/posts/f5449c93-1666-4a80-adce-9648cfa75715">
<meta data-n-head="true" data-hid="og-image" property="og:image" content="https://api.skryit.com/media/f0759ad8-9d30-4e28-8d23-a4e3fc198114.png">

[我试图获得Facebook的份额以拉出正确的元图像og:image,但不是。

我正在使用facebook debugger进行调试

我得到以下内容

Provided og:image, https://api.skryit.com/media/f0759ad8-9d30-4e28-8d23-a4e3fc198114.png 
could not be downloaded. This can happen due to several different reasons such as your server 
using unsupported content-encoding. The crawler accepts deflate and gzip content encodings.

但不是真的。使用gzip检查网络标签。

然后我开始检查nginx。

这是我的配置(部分)

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2 ipv6only=on;

    ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem;        

    ssl_protocols TLSv1.3;# Requires nginx >= 1.13.0 else use TLSv1.2
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparam.pem; # openssl dhparam -out /etc/nginx/dhparam.pem 4096
    ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
    ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
    ssl_session_timeout  10m;
    ssl_session_cache shared:SSL:10m;
    ssl_session_tickets off; # Requires nginx >= 1.5.9
    ssl_stapling on; # Requires nginx >= 1.3.7
    ssl_stapling_verify on; # Requires nginx => 1.3.7
    resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;
    # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";


    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        alias /home/proj/staticfiles/;
      }
    location /media/ {
        alias /home/proj/media/;
    }
    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
        proxy_ssl_server_name on;
    }
}

我检查了nginx日志并在error.log中找到了此>

    2019/12/11 23:35:32 [crit] 8037#8037: *232 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 18.212.76.137, server: 0.0.0.0:443
    2019/12/11 23:38:05 [crit] 9257#9257: *7 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 173.252.83.9, server: 0.0.0.0:443
    2019/12/11 23:38:06 [crit] 9257#9257: *8 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 173.252.83.19, server: 0.0.0.0:443
    2019/12/12 00:07:11 [crit] 9257#9257: *33 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 18.212.76.137, server: 0.0.0.0:443
    2019/12/12 00:07:54 [crit] 9257#9257: *34 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 128.14.134.170, server: 0.0.0.0:443
    2019/12/12 00:20:04 [crit] 9257#9257: *65 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: 184.105.139.69, server: 0.0.0.0:443

我已进一步尝试解决上述错误。添加proxy_ssl_server_name on无效。我已经考虑了另一种解决方案,但是对于解决我遇到的问题并没有真正的帮助。

我具有以下元标记

facebook nginx meta-tags
1个回答
0
投票

该解决方案在@Wizkid的帮助下起作用。

© www.soinside.com 2019 - 2024. All rights reserved.