Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JSON assets #131

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/details/lua_nginx_module.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/details/ngx_http_fastcgi_module.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/details/ngx_http_js_module.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[4,"js_include","Specifies a file that implements location and variable handlers in njs:","<p>Specifies a file that implements location and variable handlers in njs:</p><blockquote class=\"example\"><pre>nginx.conf:\njs_include http.js;\nlocation /version {\n js_content version;\n}\n\nhttp.js:\nfunction version(r) {\n r.return(200, njs.version);\n}\n</pre></blockquote><p>The directive was made obsolete in version <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.4.0\">0.4.0</a> and was removed in version <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.1\">0.7.1</a>. The <a href=\"https://nginx.org/en/docs/http/ngx_http_js_module.html#js_import\">js_import</a> directive should be used instead.</p>",[],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_include</strong> <code>file</code>;</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code><br></td></tr></tbody></table>"],
[4,"js_path","Sets an additional path for njs modules.","<p>Sets an additional path for njs modules.</p><blockquote class=\"note\">The directive can be specified on the <code>server</code> and <code>location</code> level since <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.7\">0.7.7</a>.</blockquote>",["The directive can be specified on the `server` and `location` level since [0.7.7](https://nginx.org/en/docs/njs/changes.html#njs0.7.7)."],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_path</strong> <code>path</code>;</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code>, <code>server</code>, <code>location</code><br></td></tr></tbody></table><p>This directive appeared in version 0.3.0.</p>"],
[4,"js_periodic","Specifies a content handler to run at regular interval. The handler receives a [session object](https://nginx.org/en/docs/njs/reference.html#periodic_session) as its first argument, it also has access to global objects such as [ngx](https://nginx.org/en/docs/njs/reference.html#ngx).","<p>Specifies a content handler to run at regular interval. The handler receives a <a href=\"https://nginx.org/en/docs/njs/reference.html#periodic_session\">session object</a> as its first argument, it also has access to global objects such as <a href=\"https://nginx.org/en/docs/njs/reference.html#ngx\">ngx</a>.</p><p>The optional <code>interval</code> parameter sets the interval between two consecutive runs, by default, 5 seconds.</p><p>The optional <code>jitter</code> parameter sets the time within which the location content handler will be randomly delayed, by default, there is no delay.</p><p>By default, the <code>js_handler</code> is executed on worker process 0. The optional <code>worker_affinity</code> parameter allows specifying particular worker processes where the location content handler should be executed. Each worker process set is represented by a bitmask of allowed worker processes. The <code>all</code> mask allows the handler to be executed in all worker processes.</p><p>Example:</p><blockquote class=\"example\"><pre>example.conf:\n\nlocation @periodics {\n # to be run at 1 minute intervals in worker process 0\n js_periodic main.handler interval=60s;\n\n # to be run at 1 minute intervals in all worker processes\n js_periodic main.handler interval=60s worker_affinity=all;\n\n # to be run at 1 minute intervals in worker processes 1 and 3\n js_periodic main.handler interval=60s worker_affinity=0101;\n\n resolver 10.0.0.1;\n js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem;\n}\n\nexample.js:\n\nasync function handler(s) {\n let reply = await ngx.fetch('https://nginx.org/en/docs/njs/');\n let body = await reply.text();\n\n ngx.log(ngx.INFO, body);\n}\n</pre></blockquote>",[],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_periodic</strong> <code>function</code> | <code>module.function</code> [<code>interval</code>=<code>time</code>] [<code>jitter</code>=<code>number</code>] [<code>worker_affinity</code>=<code>mask</code>];</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>location</code><br></td></tr></tbody></table><p>This directive appeared in version 0.8.1.</p>"],
[4,"js_preload_object","Preloads an [immutable object](https://nginx.org/en/docs/njs/preload_objects.html) at configure time. The `name` is used a name of the global variable though which the object is available in njs code. If the `name` is not specified, the file name will be used instead.","<p>Preloads an <a href=\"https://nginx.org/en/docs/njs/preload_objects.html\">immutable object</a> at configure time. The <code>name</code> is used a name of the global variable though which the object is available in njs code. If the <code>name</code> is not specified, the file name will be used instead.</p><blockquote class=\"example\"><pre>js_preload_object map.json;\n</pre></blockquote><p>Here, the <code>map</code> is used as a name while accessing the preloaded object.</p><p>Several <code>js_preload_object</code> directives can be specified.</p>",[],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_preload_object</strong> <code>name.json</code> | <code>name</code> from <code>file.json</code>;</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code>, <code>server</code>, <code>location</code><br></td></tr></tbody></table><p>This directive appeared in version 0.7.8.</p>"],
[4,"js_preload_object","Preloads an [immutable object](https://nginx.org/en/docs/njs/preload_objects.html) at configure time. The `name` is used as a name of the global variable though which the object is available in njs code. If the `name` is not specified, the file name will be used instead.","<p>Preloads an <a href=\"https://nginx.org/en/docs/njs/preload_objects.html\">immutable object</a> at configure time. The <code>name</code> is used as a name of the global variable though which the object is available in njs code. If the <code>name</code> is not specified, the file name will be used instead.</p><blockquote class=\"example\"><pre>js_preload_object map.json;\n</pre></blockquote><p>Here, the <code>map</code> is used as a name while accessing the preloaded object.</p><p>Several <code>js_preload_object</code> directives can be specified.</p>",[],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_preload_object</strong> <code>name.json</code> | <code>name</code> from <code>file.json</code>;</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code>, <code>server</code>, <code>location</code><br></td></tr></tbody></table><p>This directive appeared in version 0.7.8.</p>"],
[4,"js_set","Sets an njs `function` for the specified `variable`. Since [0.4.0](https://nginx.org/en/docs/njs/changes.html#njs0.4.0), a module function can be referenced.","<p>Sets an njs <code>function</code> for the specified <code>variable</code>. Since <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.4.0\">0.4.0</a>, a module function can be referenced.</p><p>The function is called when the variable is referenced for the first time for a given request. The exact moment depends on a <a href=\"https://nginx.org/en/docs/dev/development_guide.html#http_phases\">phase</a> at which the variable is referenced. This can be used to perform some logic not related to variable evaluation. For example, if the variable is referenced only in the <a href=\"https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format\">log_format</a> directive, its handler will not be executed until the log phase. This handler can be used to do some cleanup right before the request is freed.</p><blockquote class=\"note\">As the <code>js_set</code> handler returns its result immediately, it supports only synchronous operations. Thus, asynchronous operations such as <a href=\"https://nginx.org/en/docs/njs/reference.html#r_subrequest\">r.subrequest()</a> or <a href=\"https://nginx.org/en/docs/njs/reference.html#settimeout\">setTimeout()</a> are not supported.</blockquote><blockquote class=\"note\">The directive can be specified on the <code>server</code> and <code>location</code> level since <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.7\">0.7.7</a>.</blockquote>",["As the `js_set` handler returns its result immediately, it supports only synchronous operations. Thus, asynchronous operations such as [r.subrequest()](https://nginx.org/en/docs/njs/reference.html#r_subrequest) or [setTimeout()](https://nginx.org/en/docs/njs/reference.html#settimeout) are not supported.","The directive can be specified on the `server` and `location` level since [0.7.7](https://nginx.org/en/docs/njs/changes.html#njs0.7.7)."],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_set</strong> <code>$variable</code> <code>function</code> | <code>module.function</code>;</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code>, <code>server</code>, <code>location</code><br></td></tr></tbody></table>"],
[4,"js_shared_dict_zone","Sets the `name` and `size` of the shared memory zone that keeps the key-value [dictionary](https://nginx.org/en/docs/njs/reference.html#dict) shared between worker processes.","<p>Sets the <code>name</code> and <code>size</code> of the shared memory zone that keeps the key-value <a href=\"https://nginx.org/en/docs/njs/reference.html#dict\">dictionary</a> shared between worker processes.</p><p>By default the shared dictionary uses a string as a key and a value. The optional <code>type</code> parameter allows redefining the value type to number.</p><p>The optional <code>timeout</code> parameter sets the time after which all shared dictionary entries are removed from the zone.</p><p>The optional <code>evict</code> parameter removes the oldest key-value pair when the zone storage is exhausted.</p><p>Example:</p><blockquote class=\"example\"><pre>example.conf:\n # Creates a 1Mb dictionary with string values,\n # removes key-value pairs after 60 seconds of inactivity:\n js_shared_dict_zone zone=foo:1M timeout=60s;\n\n # Creates a 512Kb dictionary with string values,\n # forcibly removes oldest key-value pairs when the zone is exhausted:\n js_shared_dict_zone zone=bar:512K timeout=30s evict;\n\n # Creates a 32Kb permanent dictionary with number values:\n js_shared_dict_zone zone=num:32k type=number;\n\nexample.js:\n function get(r) {\n r.return(200, ngx.shared.foo.get(r.args.key));\n }\n\n function set(r) {\n r.return(200, ngx.shared.foo.set(r.args.key, r.args.value));\n }\n\n function del(r) {\n r.return(200, ngx.shared.bar.delete(r.args.key));\n }\n\n function increment(r) {\n r.return(200, ngx.shared.num.incr(r.args.key, 2));\n }\n</pre></blockquote>",[],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_shared_dict_zone</strong> <code>zone</code>=<code>name</code>:<code>size</code> [<code>timeout</code>=<code>time</code>] [<code>type</code>=<code>string</code>|<code>number</code>] [<code>evict</code>];</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code><br></td></tr></tbody></table><p>This directive appeared in version 0.8.0.</p>"],
[4,"js_var","Declares a [writable](https://nginx.org/en/docs/njs/reference.html#r_variables) variable. The value can contain text, variables, and their combination. The variable is not overwritten after a redirect unlike variables created with the [set](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set) directive.","<p>Declares a <a href=\"https://nginx.org/en/docs/njs/reference.html#r_variables\">writable</a> variable. The value can contain text, variables, and their combination. The variable is not overwritten after a redirect unlike variables created with the <a href=\"https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set\">set</a> directive.</p><blockquote class=\"note\">The directive can be specified on the <code>server</code> and <code>location</code> level since <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.7\">0.7.7</a>.</blockquote>",["The directive can be specified on the `server` and `location` level since [0.7.7](https://nginx.org/en/docs/njs/changes.html#njs0.7.7)."],"<table ><tbody><tr><th>Syntax:</th><td><code><strong>js_var</strong> <code>$variable</code> [<code>value</code>];</code><br></td></tr><tr><th>Default:</th><td>—</td></tr><tr><th>Context:</th><td><code>http</code>, <code>server</code>, <code>location</code><br></td></tr></tbody></table><p>This directive appeared in version 0.5.3.</p>"]
Expand Down
Loading
Loading