Mercurial > hg > nginx-site
diff xml/en/docs/http/ngx_http_keyval_module.xml @ 2028:5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Sat, 26 Aug 2017 00:56:05 +0300 |
parents | |
children | 5382bfa8a770 |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/xml/en/docs/http/ngx_http_keyval_module.xml @@ -0,0 +1,103 @@ +<?xml version="1.0"?> + +<!-- + Copyright (C) Nginx, Inc. + --> + +<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> + +<module name="Module ngx_http_keyval_module" + link="/en/docs/http/ngx_http_keyval_module.html" + lang="en" + rev="1"> + +<section id="summary"> + +<para> +The <literal>ngx_http_keyval_module</literal> module (1.13.3) creates variables +with values taken from key-value pairs managed by the +<link doc="ngx_http_api_module.xml" id="http_keyvals">API</link>. +</para> + +<para> +<note> +This module is available as part of our +<commercial_version>commercial subscription</commercial_version>. +</note> +</para> + +</section> + + +<section id="example" name="Example Configuration"> + +<para> +<example> +http { + + keyval_zone zone=one:32k state=one.keyval; + keyval $arg_text $text zone=one; + ... + server { + ... + location / { + return 200 $text; + } + + location /api { + api write=on; + } + } +} +</example> +</para> + +</section> + + +<section id="directives" name="Directives"> + +<directive name="keyval"> +<syntax> + <value>key</value> + <value>$variable</value> + <literal>zone</literal>=<value>name</value></syntax> +<default/> +<context>http</context> + +<para> +Creates a new <value>$variable</value> whose value +is looked up by the <value>key</value> in the key-value database. +Strings are matched ignoring the case. +The database is stored in a shared memory zone +specified by the <literal>zone</literal> parameter. +</para> + +</directive> + + +<directive name="keyval_zone"> +<syntax> + <literal>zone</literal>=<value>name</value>:<value>size</value> + [<literal>state</literal>=<value>file</value>]</syntax> +<default/> +<context>http</context> + +<para> +Sets the <value>name</value> and <value>size</value> of the shared memory zone +that keeps the key-value database. +Key-value pairs are managed by the +<link doc="ngx_http_api_module.xml" id="http_keyvals">API</link>. +</para> + +<para> +The optional <literal>state</literal> parameter specifies a <value>file</value> +that keeps the current state of the key-value database in the JSON format +and makes it persistent across nginx restarts. +</para> + +</directive> + +</section> + +</module>