Amazon S3 Image Issue - Share with Facebook - Meta Tag "og:image" - NextJS

Viewed 665

I am writing codes to share the page of my website into the facebook. I have used meta tags for open graphs. Previously, the images of the pages were stored in the server itself and I used to supply the link to that image in the meta tag as:

<meta
  key="og:image"
  property="og:image"
  content={coverImage} // link to the image
>

While sharing on facebook, everything worked fine. The image was displayed properly along with title and descriptions.

Recently, I have changed the image store to amazon s3 instead of storing it in server. Now, the coverImage has the link of S3. I supply this link in open graph image tag but the facebook is not previewing the image. I clear the cache, scraped the url again, but the facebook shows the warning: "Provided og:image, https://***.s3.ap-south-1.amazonaws.com/......*.jpg 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."

This image is being previewed everywhere else and I have used ContentType :'image/jpeg', ContentEncoding: 'base64',. I am not really sure why this is being blocked in facebook.

I would be very grateful if anyone could help me resolve this thing.

Thanks in advance.

1 Answers

So, I added the S3 base URL to the App Domain section on "Facebook Developer Console" and it started working. enter image description here

Related