# HG changeset patch # User Ruslan Ermilov # Date 1382003694 -14400 # Node ID 271e735e4576f681794b332cb25d1af43cf345d0 # Parent c163e997d8196a9015a1bfb43bbd7a9e657aa548 Undocumented unreleased changes to the sticky module. diff --git a/xml/en/docs/http/ngx_http_upstream_module.xml b/xml/en/docs/http/ngx_http_upstream_module.xml --- a/xml/en/docs/http/ngx_http_upstream_module.xml +++ b/xml/en/docs/http/ngx_http_upstream_module.xml @@ -10,7 +10,7 @@ + rev="10">
@@ -203,14 +203,6 @@ marks the server as permanently unavaila the directive. -route=string - -sets the server route name. - -This functionality is available as part of our only. - - - @@ -701,32 +693,24 @@ This directive is available as part of o - -cookie name + +name [expires=time] -[domain=domain] +[domain=host] [path=path] -route variable ... upstream -1.5.7 Enables session affinity, which causes requests from the same client to be passed to the same server in a group of servers. -Two methods are available, -cookie and route. - - - -When the cookie method is used, information about the -designated server is passed in an HTTP cookie: +Example: upstream backend { server backend1.example.com; server backend2.example.com; - sticky cookie srv_id expires=1h domain=.example.com path=/; + sticky_cookie_insert srv_id expires=1h domain=example.com path=/; } @@ -735,19 +719,20 @@ upstream backend { A request that comes from a client not yet bound to a particular server is passed to the server selected by the configured balancing method. Further requests from the same client are passed to the same server. -If the designated server cannot process a request, the new server is -selected as if the client has not been bound yet. +If a request cannot be processed by the bound server, the new server +is selected as if the client was not yet bound. -The first parameter sets the name of the cookie to be set or inspected. +Information about the bound server is kept in an HTTP cookie. +The first parameter sets the name of the cookie to be inserted or inspected. Additional parameters may be as follows: expires Sets the time for which a browser should keep the cookie. -The special value max will cause the cookie to expire on +The parameter max will cause the cookie to expire on “31 Dec 2037 23:55:55 GMT”. This is the maximum time understood by old browsers. If the parameter is not specified, it will cause the cookie to expire at @@ -769,48 +754,6 @@ If any parameters are omitted, the corre -When the route method is used, proxied server assigns -client a route on receipt of the first request. -All subsequent requests from this client will carry routing information -in a cookie or URI. -This information is compared with the “route” parameter -of the directive to identify the server to which the -request should be proxied. -If the designated server cannot process a request, the new server is -selected by the configured balancing method as if there is no routing -information in the request. - - - -The parameters of the route method specify variables that -may contain routing information. -The first non-empty variable is used to find the matching server. - - - -Example: - -map $cookie_jsessionid $route_cookie { - ~.+\.(?P<route>\w+)$ $route; -} - -map $request_uri $route_uri { - ~jsessionid=.+\.(?P<route>\w+)$ $route; -} - -upstream backend { - server backend1.example.com route=a; - server backend2.example.com route=b; - - sticky route $route_cookie $route_uri; -} - -Here, the route is taken from the “JSESSIONID” cookie -if present in a request. -Otherwise, the route from the URI is used. - - - This directive is available as part of our only. @@ -819,29 +762,6 @@ This directive is available as part of o - -name -[expires=time] -[domain=domain] -[path=path] - -upstream - - -This directive is obsolete since version 1.5.7. -An equivalent - directive with a new syntax should be used instead: - -sticky cookie name -[expires=time] -[domain=domain] -[path=path]; - - - - - - @@ -973,13 +893,6 @@ The opposite of the “down” parameter of the directive. - -route=string - -Same as the “route” parameter -of the directive. - - The first three parameters select a target the command applies to.