Tangible Bytes

A Web Developer’s Blog

Next.js Multisite on Kubernetes

I am working on a Next.js project that has 9 websites with different content and themes but the exact same structure.

We want one codebase and one server to reduce costs (and the carbon footprint of our cloud) and also to streamline the process of releasing new features.

So we’re using middleware to detect which host the incoming request is for and add that as a parameter - which worked fine in development but I had some problems moving to our production system which is in Kubernetes.

Read more ...

Next.js Environment Variables

I’m running Next.js apps in production using Kubernetes - and I’ve inherited some setup that I didn’t fully understand so I’ve been investigating what is going on with environment variables.

My inherited system used a build per environment and bakes in configuration at that point.

I dislike this because …

Read more ...