flag

The `flag` directive in the NGINX Proxy-Wasm module is used to set specific behavior flags for WebAssembly modules during execution.

Syntaxflag flag_type value;
Defaultnone
Context
Arguments2

Description

The flag directive allows users to customize the execution of WebAssembly modules in NGINX by specifying flags that control the module's behavior. This directive accepts two arguments: the first is the type of flag to set, and the second is the corresponding value that indicates the state of the flag (enabled or disabled). The flags can be used to toggle various features or behaviors of the WebAssembly host environment, providing a mechanism to optimize performance or enable experimental features.

In essence, when specifying a flag, you provide the NGINX server with instructions on how to handle certain aspects of the WebAssembly execution context. The functionality tied to these flags can help with metrics collection, debugging, or feature toggling. Depending on the value set, different paths or processes within the NGINX runtime can be triggered, thus influencing how requests are processed under specific conditions.

Config Example

wasm {
    module my_module /path/to/module.wasm;
    flag some_flag enabled;
}

Ensure that the flag type is correctly specified; using an invalid type can lead to runtime errors.

Be cautious of the value you pass; passing unexpected values may not yield the desired effect.

← Back to all directives