Using Rust modules in nginx
Use LuaJIT to run native Rust modules in Nginx
##
FROM ubuntu:24.04
RUN apt-get -y update
RUN apt-get -y install nginx libnginx-mod-http-lua luajit
RUN mkdir /etc/nginx/lualib
CMD ["nginx", "-g", "daemon off;"]
Set up the Rust project
$ cargo new --lib ngx-rust-json
$ cd ngx-rust-json
$ cargo add mlua --features luajit,module,serialize
$ cargo add serde_json