Change storage folder on other sub domain

Hello,

My Cockpit work on a sub domain and I use Cockpit API to get the information in the site. I want to change storage folder, for some security reason, on other sub domain and all uploads must going there.

I’ve create a defines.php file with define("COCKPIT_STORAGE_FOLDER", "/home/sub_domain_name/root/assets");. The folder has 0755 rights.

After uploads defines.php in Cockpit root directory the system immediately return Error 500.

Is it possible to change the upload folder in another sub domain?

My site in based on CodeIgniter Web Framework if this has matter.

P.S. Excuse my self for my English…

I might be wrong, but if you want to save to another subdomain out of your server you should use CloudStorage plugin.

A time ago I asked how to change name files after upload and storage folder location… I hope that helps you.

1 Like

Should be possible, you can for example:

Setup a Nginx to serve your static files on https://assets.yourdomain.com
Make the docroot point to the storage assets folder or create a symlink
On your website just make sure you prefix the cockpit assets with your hostname.

1 Like