Mercurial > hg > nginx-site
changeset 2041:29b68a7b42fc
Documented cookie name for sticky cookie and server route.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 22 Sep 2017 16:44:05 +0300 |
parents | 093855e77388 |
children | 30e2bd353998 |
files | xml/en/docs/http/ngx_http_upstream_module.xml xml/ru/docs/http/ngx_http_upstream_module.xml |
diffstat | 2 files changed, 39 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_upstream_module.xml +++ b/xml/en/docs/http/ngx_http_upstream_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_upstream_module" link="/en/docs/http/ngx_http_upstream_module.html" lang="en" - rev="61"> + rev="62"> <section id="summary"> @@ -835,6 +835,25 @@ selected as if the client has not been b <para> The first parameter sets the name of the cookie to be set or inspected. +The cookie value is +a hexadecimal representation of the MD5 hash of the IP address and port, +or of the UNIX-domain socket path. +However, if the “<literal>route</literal>” parameter of the +<link id="server"/> directive is specified, the cookie value will be +the value of the “<literal>route</literal>” parameter: +<example> +upstream backend { + server backend1.example.com route=<emphasis>a</emphasis>; + server backend2.example.com route=<emphasis>b</emphasis>; + + sticky cookie srv_id expires=1h domain=.example.com path=/; +} +</example> +In this case, the value of the “<literal>srv_id</literal>” cookie will be +either <value>a</value> or <value>b</value>. +</para> + +<para> Additional parameters may be as follows: <list type="tag">
--- a/xml/ru/docs/http/ngx_http_upstream_module.xml +++ b/xml/ru/docs/http/ngx_http_upstream_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_upstream_module" link="/ru/docs/http/ngx_http_upstream_module.html" lang="ru" - rev="61"> + rev="62"> <section id="summary"> @@ -842,6 +842,24 @@ upstream backend { <para> Первый параметр задаёт имя куки, которую необходимо установить или проверить. +Значением куки является MD5-хэш IP-адреса и порта +(или пути UNIX-сокета) в шестнадцатеричном виде. +Однако если указан параметр “<literal>route</literal>” +директивы <link id="server"/>, то значением куки будет +значение параметра “<literal>route</literal>”: +<example> +upstream backend { + server backend1.example.com route=<emphasis>a</emphasis>; + server backend2.example.com route=<emphasis>b</emphasis>; + + sticky cookie srv_id expires=1h domain=.example.com path=/; +} +</example> +В этом случае значение куки “<literal>srv_id</literal>” будет +или <value>a</value>, или <value>b</value>. +</para> + +<para> Дополнительные параметры могут быть следующими: <list type="tag">