Merge branch 'worker' into 'develop'

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

See merge request soapbox-pub/soapbox-fe!1660
environments/review-develop-3zknud/deployments/596
Alex Gleason 2 years ago
commit ea5fb4ec5a

@ -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.

Loading…
Cancel
Save