Compile-Time Code Generation & Metaprogramming
ROFL with a LOL: rewriting an NGINX module in Rust

ROFL with a LOL: rewriting an NGINX module in Rust

2/24/2023 · Sam Howson

What this post added

This post details the development of ROFL, a new NGINX module written in Rust to replace the legacy cf-html component. It explains the motivation for the rewrite, focusing on memory safety improvements and performance gains by using the lol-html Rust library. The post provides technical details on how to generate FFI bindings between NGINX and Rust using Bindgen and discusses the use of NGINX's dynamic module loading. It highlights the deprecation of a critical and historically problematic piece of code (cf-html) and the provision of a robust system for response body parsing and rewriting.

Read the original post ↗