sforkowany z mirror/soapbox
Docs: add Soapbox Worker to "Deploy at scale" doc
rodzic
077b2398ba
commit
af48edc679
|
@ -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.
|
||||
|
|
Ładowanie…
Reference in New Issue