proxy_wasm_isolation

The `proxy_wasm_isolation` directive defines the isolation level for the execution of WebAssembly (Wasm) modules within NGINX's proxy environment.

Syntaxproxy_wasm_isolation level;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The proxy_wasm_isolation directive is part of the NGINX Proxy-Wasm support, which facilitates the integration of WebAssembly modules for enhanced request processing. This directive can be configured in three contexts: http, server, and location, meaning it can apply to large-scale server configurations or be tailored for specific routes. By setting this directive, users can specify the level of isolation that the WebAssembly modules will have during execution, which can be crucial for performance and security depending on the use case.

The directive takes a single argument that defines the desired isolation mode, which can include options like thread isolation to prevent state sharing between instances or various other configurations that affect how modules interact with the global NGINX server environment. This allows for a fine-tuned balance between resource efficiency and separation of execution contexts, thereby enhancing both security and reliability when handling concurrent requests.

When using proxy_wasm_isolation, it is essential to understand the implications of the chosen isolation level on performance and potential resource contention among modules, especially under high loads. Users are encouraged to test different configurations to find the optimal setup that meets their application's needs based on the complexity and resource demands of the Wasm modules used.

Config Example

http {
    proxy_wasm_isolation thread;
    server {
        listen 9000;
        location / {
            proxy_pass http://backend;
            proxy_wasm my_filter;
        }
    }
}

Ensure the isolation level is supported by your Wasm module; unsupported configurations may lead to errors.

Misconfiguration can lead to performance issues, as higher levels of isolation often result in increased overhead.

← Back to all directives