NodeBB Assets - Object Storage
-
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?
-
@phenomlab try clearing your cache. You can deactivate the plugin with
./nodebb reset -p @nodebb/nodebb-plugin-cdn
-
-
@phenomlab what does crashing the admin console look like? And if you had any CDN stuff in your nginx config you'll need to clear you're cache again. Try a different browser if you haven't already.
The CDN plugin doesn't store anything in the database except for the settings key you've already deleted. You will need to restart NodeBB after deleting the key in order for that to take effect.
-
@PitaJ It looks like this
6Fetch finished loading: GET "<URL>". admin:46 GET https://sudonix.dev/assets/plugins/nodebb-plugin-markdown/styles/obsidian.css net::ERR_ABORTED 404 18Fetch failed loading: GET "<URL>". admin:45 GET https://sudonix.dev/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=kccgr37fq3g net::ERR_ABORTED 404 admin:49 GET https://sudonix.dev/assets/admin.css?v=kccgr37fq3g net::ERR_ABORTED 404 admin:61 GET https://sudonix.dev/assets/admin.min.js?v=kccgr37fq3g net::ERR_ABORTED 404 admin:987 Uncaught ReferenceError: $ is not defined at HTMLDocument.prepareFooter (admin:987:4) prepareFooter @ admin:987 13The FetchEvent for "<URL>" resulted in a network error response: the promise was rejected. service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 service-worker.js:14 Uncaught (in promise) TypeError: Failed to fetch at service-worker.js:14:11 (anonymous) @ service-worker.js:14 admin:34 GET https://sudonix.dev/assets/src/modules/composer.js?v=kccgr37fq3g net::ERR_FAILED admin:35 GET https://sudonix.dev/assets/src/modules/composer/uploads.js?v=kccgr37fq3g net::ERR_FAILED admin:36 GET https://sudonix.dev/assets/src/modules/composer/drafts.js?v=kccgr37fq3g net::ERR_FAILED admin:37 GET https://sudonix.dev/assets/src/modules/composer/tags.js?v=kccgr37fq3g net::ERR_FAILED admin:38 GET https://sudonix.dev/assets/src/modules/composer/categoryList.js?v=kccgr37fq3g net::ERR_FAILED admin:39 GET https://sudonix.dev/assets/src/modules/composer/resize.js?v=kccgr37fq3g net::ERR_FAILED admin:40 GET https://sudonix.dev/assets/src/modules/composer/autocomplete.js?v=kccgr37fq3g net::ERR_FAILED admin:41 GET https://sudonix.dev/assets/templates/composer.tpl?v=kccgr37fq3g net::ERR_FAILED admin:42 GET https://sudonix.dev/assets/language/en-GB/topic.json?v=kccgr37fq3g net::ERR_FAILED admin:46 GET https://sudonix.dev/assets/plugins/nodebb-plugin-markdown/styles/obsidian.css net::ERR_FAILED admin:44 GET https://sudonix.dev/assets/language/en-GB/tags.json?v=kccgr37fq3g net::ERR_FAILED admin:43 GET https://sudonix.dev/assets/language/en-GB/modules.json?v=kccgr37fq3g net::ERR_FAILED admin:47 GET https://sudonix.dev/assets/language/en-GB/markdown.json?v=kccgr37fq3g net::ERR_FAILED touchicon-144.png:1 GET https://sudonix.dev/assets/uploads/system/touchicon-144.png 404 admin:1 Error while trying to use the following icon from the Manifest: https://sudonix.dev/assets/uploads/system/touchicon-144.png (Download error or resource isn't a valid image)
The site can no longer be loaded. I see traffic building on the CDN, but even with removing NGINX and just using NodeJS to serve the site, it's the same. The site is not rendered correctly, and I see a stack of errors in the console
One of particular interest is this
(blocked:NotSameOrigin)
The odd thing is that I'm pretty sure I enabled this in terms of CORS settings.
I've tried 5 different browsers and they all do the same thing.
-
What's more odd here is that the critical js files NodeBB needs are not being redirected to the CDN - see
Whereas others are
More concerning is that the assets still pointing to the origin server are now serving a 404
I think there is an issue with this plugin which prevents it from working correctly.