Docs: add Soapbox Worker to "Deploy at scale" doc

rtk-query
Alex Gleason 2022-07-19 20:41:22 -05:00
rodzic 077b2398ba
commit af48edc679
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 14 usunięć

Wyświetl plik

@ -109,17 +109,4 @@ AKA "why don't links to my website show a preview when posted on Facebook/Twitte
Deploying with Nginx means that you forego the link preview functionality offered by Pleroma and Mastodon, since Soapbox has no knowledge of the backend whatsoever.
This problem has no official solution, but we have some ideas:
1. Serve different content to link crawlers based on their `user-agent`.
2. Inject metadata into `index.html` somehow based on the URL.
The first solution is probably the most straightforward, and can be achieved in Nginx like so:
```nginx
if ($http_user_agent ~* "googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp") {
# TODO: route to backend?
}
```
See [this snippet](https://gist.github.com/thoop/8165802) for more information.
Our official solution is [Soapbox Worker](https://gitlab.com/soapbox-pub/soapbox-worker), a Cloudflare Worker that intercepts the reqest/response and injects metadata into the page by querying the API behind the scenes.