
I built SSR in NGINX using njs. Here’s what I learned
I built a minimal SSR runtime directly inside NGINX — and ended up using it in production. For some time, I’ve been using NGINX with njs for things like CSP nonce generation and request-level logic. This started as an extension of something I was already using in production (CSP handling in NGINX). At some point I asked myself a simple question: can this go a bit further? This started as a small experiment — but it ended up running in production on my personal website. What I built 👉 https://github.com/kraftdorian/nginx-njs-ssr-starter A minimal SSR-like runtime using: NGINX njs (JavaScript inside NGINX) simple component rendering patterns No Node.js. No Next.js. Just NGINX. The runtime is intentionally small and explicit — closer to a rendering utility than a framework. How it works (high-level) Instead of: Client → Node SSR → HTML I explored: Client → NGINX (njs) → HTML The idea is simple: execute JavaScript during request handling (via njs) generate HTML on the fly return it directl
Continue reading on Dev.to
Opens in a new tab



