Hi, I'm Brett

Marketing Specialist

Building a Better CDN


Over the many years that I’ve been self-hosting my own media, I’ve had a few issues, some of which include peering from a relatively cheap storage provider in the EU to Toronto. While both Germany and Toronto have major internet exchanges fairly close by, there’s nothing quite like getting content closer to the edge.

By both teaching myself AWS Route53, and setting up servers in multiple locations to bounce and cache as necessary, setting up a CDN using NGINX and Geolocated DNS isn’t as hard as it used to be, and is a relatively cheap way to move large amounts of traffic without Cloudflare (while I love them, they don’t seem to like hosting GB of site images or moving a few TB a month). So, I ended up building my own infrastructure to do this for me.

The NGINX reverse proxy module is a very robust mechanism that allows for a single resource to be sent to the edge. Alongside NGINX caching, and the map module, you can do a very good job of getting those posters closer to the users, reducing page load times significantly.

While I have a full writeup on configuration here, it’s important to note that you can continue to scale this out across multiple continents if your wallet is deep enough.

An example of how a CDN might work.