Unable to generate preview for URLs

Our Discourse is unable to generate preview for our domain, even as I’ve made sure that our OpenGraph tags are valid and in fact shows up in iframely as recommended by some other posts in this forum.

URL:

iframely:

Your site is returning error HTTP 503 for HEAD requests. You must fix that.

➜  ~ curl https://royaleapi.com/player/QVPJRV -I
HTTP/2 503 
date: Mon, 11 Jan 2021 16:02:46 GMT
content-type: text/html; charset=utf-8
set-cookie: __cfduid=da03fb9dd5542a32b6480f771b47625421610380966; expires=Wed, 10-Feb-21 16:02:46 GMT; path=/; domain=.royaleapi.com; HttpOnly; SameSite=Lax; Secure
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
referrer-policy: same-origin
content-security-policy: frame-ancestors 'self' royaleapi.com royaleapi.com:* cdn.royaleapi.com *.royaleapi.com:* openfam.com fam.gg http://*.royaleapi.com:* http://royaleapi.com:* https://*.royaleapi.com:* https://royaleapi.com:*;
cf-cache-status: DYNAMIC
cf-request-id: 0793c892310000f86b2b1d8000000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=UcIDjxpg0nJjooYIS92dS6xIvO7MzxWAjbcOCb2jq%2Fa4hyqavfjNdE2eloPIyWmWzjxJl1rJJX%2BU4ADREdpehv01nWVT2mtvg9fyV%2FlVaVoXtXKAg2D%2Fl2hd"}],"group":"cf-nel","max_age":604800}
nel: {"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 60ffdd30485cf86b-GIG

2 Likes

I see. Yes, I’ve disabled HEAD requests on the site. I’ll try to re-enable it — though I’m not sure why preview requires head requests to operate?

@Falco I have fixed the issue, so now the previews do get displayed.

However, anything that was previously deemed “unpreviewable” doesn’t seem to show up anymore. It appears that Discourse has saved URLs that it cannot fetch with HEAD previously in some type of cache (this is just me guessing). What can I do to invalidate that data and make it try to fetch previews of all URLs?

I just did a rebuild of the post in the OP here and it was enough.

So Rebake all posts matching a pattern should help you.

1 Like