Skip to content

nginx-modules/nginx-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-rs

crates.io MIT License

Note [Feb 2023] I haven't had a chance to work on this recently, but you might be interested in Cloudflare's blog post ROFL with a LOL: rewriting an NGINX module in Rust, which takes some inspiration from this module.

A framework for writing Nginx modules in pure Rust.

This module is in early stages. It lacks documentation and the API is still quite unstable. But it can be used to write simple request handlers for content or access control.

Building Modules

Building modules requires a checkout of the Nginx sources configured for building dynamic modules:

export NGINX_DIR=/path/to/nginx
cd "${NGINX_DIR}"
auto/configure --with-compat

Once Nginx is configured, you can then build your module:

cd /path/to/module
cargo build --release

The resulting .so in target/release can then be loaded using the load_module directive.

Examples

  • hello_world — Demonstrations access control and content handlers

Licence

This project is licensed under the terms of the MIT license.

About

Nginx module written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.0%
  • C 1.0%