php - Facebook/Twitter OpenGraph not scraping images on Node.js/Angular.js web application


I have recently worked on a MEAN Stack application, a sort of blog in a way, where authors post articles. To overcome the issue of OpenGraph applications not scraping Javascript, I implemented a static php page and a rule on my Nginx reverse proxy that redirects all calls from certain user-agents (like Facebook, Google+, Twitter, etc) to the static page, in order to properly scrape the data.

Everything is working great, except for one little detail, the OpenGraph based applications can't seem to be able to scrape the images in the articles, so the rich social sharing doesn't work out as expected.

For instance, testing the following link :

which redirects to the static page :

  • Facebook Sharing Debugger gives out the following errors - randomly :

Unsupported Image File Extension Provided og:image URL, does not have a supported extension.


The provided 'og:image' properties are not yet available because new images are processed asynchronously. To ensure shares of new URLs include an image, specify the dimensions using 'og:image:width' and 'og:image:height' tags.

  • Twitter Card Validator Log: (No Image)

INFO: Page fetched successfully INFO: 17 metatags were found INFO: twitter:card = summary tag found INFO: Card loaded successfully WARN: this card is redirected to

I've tried adding extra tags like image width/height, changed image format, secure tags, etc. Nothing worked.

Did anyone else stumble across such an issue?

Thanks in advance!




For Twitter's card crawler, there is an in-depth troubleshooting FAQ here and here.

I just tried the following request to fetch the image referenced in the page:

curl -L -A Twitterbot -v

This returns an HTML page, not a JPEG image. This means that Twitter's card crawler is unable to fetch a valid image.

You should fix your server to return a valid JPEG image to the Twitterbot user-agent.

People are also looking for solutions to the problem: PHP htmlentities or htmlspecialchars


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.