NodeBB Assets - Object Storage
-
Hi there,
Greetings!
I have been thinking about serving assets from an S3 bucket or another object storage. (I came across the plugin https://github.com/NodeBB-Community/nodebb-plugin-s3-uploads but yet to check)
I was wondering whether it's possible to "effectively" serve from S3 buckets/a different object storage in different availability zones depending on the client (US/UK/Europe/Asia) to reduce the time that the assets take to load.
Also, I would love to hear about any other possible configurations anyone is using/suggesting with "serving different geo-locations" in mind.
Thank you
-
If you use multiple S3 geolocations, you force the S3 plugin to upload one resource to multiple S3 endpoints. I think it's not a great idea for the server to handle this kind of duplication; it's best left for a CDN to do this. CDN does a better job at delivering static file than different S3 geolocations do.
-
@julian I'm interested in how any CDN could work with NodeBB as there is no plugin to control what is in the push or pull zone - unless you are referring to Cloudflare which isn't a CDN in the typical sense.
-
There's https://github.com/NodeBB/nodebb-plugin-cdn but it's probably incompatible with newer NodeBB versions
-
What is the url of the requested file? And is privateUploads turned on in your settings? I think this plugin doesn't work if uploaded files are private. https://github.com/NodeBB/nodebb-plugin-cdn/commit/59a069827340e718d860a3ecf458b9a01ffc4711
-
@baris I've set the URL to https://cdn.sudonix.dev and uploads are not private. The URL of the requested assets in this case should be https://cdn.sudonix.dev but are in fact https://sudonix.dev
-
The CDN plugin uses redirects. It doesn't need the nginx stuff, that's just optimization. (nginx is much better at a simple redirect rule than nodejs) I'm not sure exactly what you're doing in the browser console but it's likely you will still get initial requests to your NodeBB domain, especially if your cache is disabled like the browser tools often does when open.
-
@phenomlab yeah I'd get it working without nginx first. What exactly do you see in your browser network tab?