HTTP JavaScript directives

js_body_filter (http-js)

Selects a synchronous per-buffer response body filter.

Formal Syntax & Structure

nginx syntaxnginx
js_body_filter module.function [buffer_type=string | buffer];

Parameters & Attributes

NameTypeDescription
handlermodule.functionSynchronous chunk filter, not whole-response transformation.
buffer_typebuffer_type=string | bufferDefault string; use buffer for binary content. If length changes, remove stale Content-Length in header filter.

Working Example

Example Snippetnginx
js_body_filter app.upper;
Nginx Reference