I am trying to serve my uploaded images from a CDN subdomain (assets.veryfb.com) instead of the main domain. I am using the FoF Upload extension with the Local storage driver.
Current Setup & Steps Taken:
Database Migration: I successfully ran a SQL replacement on the posts table to update old URLs to the new CDN domain.
Extension Settings: In the FoF Upload settings, I have set the "CDN URL" (or "File URL Prefix") to https://assets.abc.com.
Cache: I have cleared the Flarum cache (php flarum cache:clear) and Cloudflare cache multiple times.
The Problem: Despite the above settings, the images are still not rendering with the CDN URL. Crucially, when I edit and save a post (forcing a re-render):
The UPL-IMAGE-PREVIEW tag re-generates the HTML.
Result: The URL reverts to the local path (https://abc.com/assets/files/...) and completely ignores the "CDN URL" I entered in the extension settings.
My Question: Does the "CDN URL" setting in FoF Upload apply to the local storage driver? Or is the only way to achieve this by overriding the disks configuration in config.php (as shown below)?
PHP
// Is this the required fix?
'disks' => [
'flarum-uploads' => [
'driver' => 'local',
'root' => '/path/to/public/assets/files',
'url' => 'https://assets.veryfb.com', // Forcing the URL here
],
],
I want to confirm if this is a bug/limitation in the extension settings, or if modifying config.php is the standard best practice for this scenario.
Thanks!