wasmer

The `wasmer` directive enables the integration of WebAssembly modules into NGINX for enhanced request processing capabilities.

Syntaxwasmer;
Defaultnone
Context
Argumentsnone

Description

The wasmer directive is part of the NGINX module that provides support for WebAssembly (Wasm) through the Proxy-Wasm ABI. This allows developers to run WebAssembly modules within the NGINX environment, extending its functionality without needing to recompile or alter the core server code. WebAssembly is a binary instruction format that enables high-performance applications on the web, providing near-native speed for web applications while maintaining a safe and portable execution environment.

When using the wasmer directive, administrators can specify multiple Wasm modules that can be called during various phases of request processing. The inclusion of these modules allows for advanced features like custom filtering, metrics collection, and other logic to be processed directly within the NGINX worker processes. The directive does not take any arguments by itself but works alongside other related directives such as proxy_wasm and wasm_call, effectively orchestrating the interactions between NGINX and the Wasm modules.

Config Example

wasm {
    module my_filter /path/to/filter.wasm;
}

Ensure the Wasm module is correctly compiled for the correct architecture.

Modules should be optimized for performance as they run within the NGINX worker context.

Incorrect paths will lead to module loading failures, verify the module path.

← Back to all directives