# HG changeset patch # User Vladimir Homutov # Date 1375959100 -14400 # Node ID 48ab154edf1034298e47aa74ce24de3d4132bebb # Parent fbb4cc6f8c3ddcdbc2865a1ddf706329e572fc86 Upstream: removed obsoleted directives in the "sticky" module. The "sticky" and "sticky_log_requests" directives were removed. The sticky feature description has been revised. diff -r fbb4cc6f8c3d -r 48ab154edf10 xml/en/docs/http/ngx_http_upstream_module.xml --- a/xml/en/docs/http/ngx_http_upstream_module.xml Wed Aug 07 10:10:59 2013 +0400 +++ b/xml/en/docs/http/ngx_http_upstream_module.xml Thu Aug 08 14:51:40 2013 +0400 @@ -10,7 +10,7 @@ + rev="7">
@@ -689,82 +689,6 @@ - - - -upstream - - -Enables session affinity support. -The session is an object that is used to uniquely identify and maintain the -state of a client during a given period of time. -If session affinity is enabled, requests from the same client are always passed -to the same server (in a group of servers) once a session has been created. -The method that is used to create and track sessions must be specified in a -separate directive, for example, . - -upstream backend { - server backend1.example.com; - server backend2.example.com; - - sticky; - sticky_cookie_insert "sticky"; -} - -server { - location / { - proxy_pass http://backend; - } -} - -The directive must be specified after the or the - directives. - - - -When the session affinity is enabled, a request is processed as follows: - - - -nginx looks up the session corresponding to the request. -If the session is found, the server identification data is extracted from it. -This data is used by the server selection algorithm. - - - -The server to process the request is chosen according to the configured -balancing method, server information from the session, and the real state of -servers in a group (such as failed, up or down). - - - -The request is passed to the chosen server for processing. -If the chosen server is not the one specified in the session -(for example, because it is down), the session is cleared -and the request is processed as if it had no session. - - - -The server returns the response. - - - -If there is no session for the request, a new session -is created and the server identification data is stored in it. - - - - - - - -This directive is available as part of our only. - - - - - - name [expires=time] @@ -774,14 +698,29 @@ upstream -Enables and configures the session tracking method that is based on keeping -session information in HTTP cookies. -The directive must be specified after the or the - directives. +Enables session affinity that causes requests from the same client to be +passed to the same server in a group of servers. Example: -sticky_cookie_insert "srv_id" "expires=1h 7m" domain=example.com path=/; +upstream backend { + server backend1.example.com; + server backend2.example.com; + + sticky_cookie_insert srv_id expires=1h domain=example.com path=/; +} + + + +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 a request cannot be processed by the bound server, the new server +is selected as if the client was not yet bound. + + + +Information about the bound server is kept in HTTP cookie. The first parameter sets the name of the cookie to be inserted or inspected. Additional parameters may be as follows: @@ -789,9 +728,11 @@ expires Sets the time for which a browser should keep the cookie. -The parameter “max” sets the time to +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 +the end of a browser session. domain @@ -817,29 +758,6 @@ - -debug | -info | -notice | -warn | -error - -upstream - - -Enables logging of session-related operations and sets the desired -logging level. - - - - -This directive is available as part of our only. - - - - - -