HTTP JavaScript directives

js_set (http-js)

Computes a variable with a synchronous handler.

Formal Syntax & Structure

nginx syntaxnginx
js_set $variable module.function [nocache];

Parameters & Attributes

NameTypeDescription
variable$variableName the computed configuration variable.
handlermodule.functionReference a synchronous handler.
nocacheliteral nocacheReevaluate on each reference since njs 0.8.6; rewrite set has fixed-length limitations.

Working Example

Example Snippetnginx
js_set $display_view app.view;
Nginx Reference