relieve tension on your servers, trust the assets to speedy
Speedy is a self-hosted CDN web application.
Stop worrying about your website not being able to handle thousands of concurrent connections because Speedy can handle it for you.
Note: Hosting Speedy in the same server as it's remote origin defeats the whole purpose of the CDN thing.
$ cd /var/www
$ git clone https://github.com/azetrix/speedy-cdn.git
[...]
root /var/www/speedy/public;
index index.php;
location / {
try_files $uri $uri/ /index.php;
}
location ~ ^/index\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
[...]
- Rename
config.sample.json
toconfig.json
. - Edit
config.json
to your heart's desire. - Make sure Speedy directory is writable.
- Deploy!
https://cdn.speedy.com/assets/img/logo.png -> https://www.origin.com/assets/img/logo.png
const ALLOWED_CONTENT_TYPES = [
'/^image\/(?:(?:(?:x-(?:citrix-)?)?png)|(?:x-(?:citrix-)?|p)?jpeg|gif|x-icon|bmp|psd|svg\+xml|webp)/i',
'/^text\/(?:css|plain|yaml|xml|xsl)/i',
'/^application\/(?:javascript|json|(?:rss\+|xhtml\+|atom\+)?xml)/i'
];