compiler

The `compiler` directive specifies the WebAssembly compiler to be used for building modules within NGINX's Proxy-Wasm support.

Syntaxcompiler "compiler_name";
Defaultnone
Context
Arguments1

Description

The compiler directive allows users to choose a specific WebAssembly compiler for the creation of Wasm modules intended for use in NGINX. This gives developers flexibility in the performance and optimization techniques employed for their WebAssembly code, as different compilers may produce varying efficiency and execution speed.

When configured, this directive expects a single argument which typically corresponds to the name or path of the compiler executable intended for this purpose. The modularity offered by the compiler directive allows administrators to leverage different compilation capabilities depending on the target environment or the expected workload. This is particularly useful for teams leveraging multiple languages and toolchains as part of their development process for Proxy-Wasm filters.

Config Example

wasm {
    compiler "wasm-opt";
    module my_filter /path/to/filter.wasm;
}

Ensure the specified compiler is installed on the server host; otherwise, NGINX will fail to start or load the module.

Using a compiler not supported by the NGINX build may lead to unexpected behavior or crashes during runtime.

← Back to all directives