facebook share Image not showing

≯℡__Kan透↙ 提交于 2020-01-06 05:03:07

问题


I have a sharepoint webpage that has a facebook share button.
however after I shared the webpage, the image is not showing in facebook.

Using the facebook tool 'Open Graph Object Debugger', I got the following error

Errors That Must Be Fixed Missing Required Property The 'og:type' property is required, but not present.

When Viewing the source of the webpage, I can clearly see that the required facebook meta data is there
<meta property="og:url" content="https%3a%2f%2fxxx.xx.xx/xx" /> <meta property="og:type" content="website" /> <meta property="og:title" content="xxx" /> <meta property="og:description" content="" /> <meta property="og:image" content="https://xxx.xx.xx/xxx.jpg" />

Anyone has any idea?


回答1:


Check if Facebook Crawler gets your page at all. There is a link at the bottom that allows seeing what Facebook scraper gets from your site. If it's empty, most probably your web server responds differently or doesn't respond at all to Facebook. I have a similar issue. In my case scraper gets the page over HTTP and gets nothing over HTTPS (SSL) despite trusted certificate.

If facebook gets nothing from you server reasons are:

  • a bad configuration of a web server
  • firewall blocks facebook scraper's IPs
  • redirect issue

Also, check status code facebook provides in Debugger if it's not 200 or 206, the problem is definitely not in an Open Graph itself.

In case it's SSL issue and you're using Letsencrypt this SSL params made my site visible to Facebook again:

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now.  You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

More details might be found here: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html




回答2:


I had this problem. The solution for me was to call my hosting provider (Godaddy in my case) and tell them to re-start PHP processes on my site.

The issue is related to caching. Your server may be serving old content in an attempt to save time.

I then visited https://developers.facebook.com/tools/debug/ and clicked the "scrape again" button.



来源:https://stackoverflow.com/questions/36470111/facebook-share-image-not-showing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!