Support Self-Hosted CDN Servers. Its a first needed function!

[details=“Support intro”]

Hello. I propose the introduction of support for Self-Hosted-CDN servers.
For High loaded projects, it is important to save files on Self-Hosted-CDN servers, to quickly process large data and support an too many users. It is important. If you add this feature, then this system will be of interest to many large companies.

How it works.
There is a server 1! NextCloud on the SSD drive, and there is a separate server 2 on the HDD hard disk with support for PHP + Apache + nginx.

On server 2, a PHP file processor with a special key is installed.

Server 1 connects to the PHP on server 2 and sends the key, verifying that it is an authentic developer server, then stores the file on server 2 using the PHP.
For example, on https://cdn1.andromedausercontent.com
And these servers can support several CDN Servers.

For example:


Here is processor.php file code:

<?php

/**
*
*@author: Andromeda Cloud, inc
*@website : andromedacenter.com
*/
$key = "dghhisddqwddwsd1HGDOS9744111210s10dsdDSxz";
$filename = (isset($_GET['name'])) ? $_GET['name'] : null;
$action = (isset($_GET['action'])) ? $_GET['action'] : null;
$userKey = (isset($_GET['key'])) ? $_GET['key'] : null;



if ($key != $userKey or !$filename or !in_array($action, ['save', 'delete'])) die('error');

$pathInfo = pathinfo($filename);

$dirPath = $pathInfo['dirname'];
$file = $pathInfo['basename'];

if (!is_dir($dirPath)) {
    @mkdir($dirPath, 0777, true);
}

if ($action == 'save') {
    //$uploadfile = $uploaddir . basename($_FILES['file_contents']['name']);
    if (move_uploaded_file($_FILES['file_contents']['tmp_name'], $filename)) {
        //echo "File is valid, and was successfully uploaded.\n";
    }
} else {
    //exit($filename);
    if (file_exists($filename)) {
        @unlink($filename);
    }
}
1 Like

I second this idea. This would open many international hosting options while only needing one site. The frontend could be low traffic and just supplying the gui and database readouts, while the actual files can be stored all over the world.