<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/ngx_http_upstream_sticky_module.c, branch release-1.30.0</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Sticky: fixed expiration of learned sessions after reload.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Aleksei Bavshin</name>
<email>a.bavshin@nginx.com</email>
</author>
<published>2026-02-17T20:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=52cda2849cbc17fe82bc006d1571e657a42dba24'/>
<id>52cda2849cbc17fe82bc006d1571e657a42dba24</id>
<content type='text'>
Previously, the expiration timer for learned session was not started
until a new session is created.  This could lead to the sessions being
active past the expiration time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the expiration timer for learned session was not started
until a new session is created.  This could lead to the sessions being
active past the expiration time.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: samesite=&lt;strict|lax|none&gt; cookie flags.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Kokshenev</name>
<email>v.kokshenev@f5.com</email>
</author>
<published>2020-11-01T23:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0380586e69fc7b0b8aa7cea2329fef54f8ae69cb'/>
<id>0380586e69fc7b0b8aa7cea2329fef54f8ae69cb</id>
<content type='text'>
Adds new options for the "sticky cookie" directive to set
samesite=&lt;strict|lax|none&gt; cookie flags.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds new options for the "sticky cookie" directive to set
samesite=&lt;strict|lax|none&gt; cookie flags.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: added the "header" parameter in the learn mode.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2017-06-08T12:39:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=8021cb02de840d6168a98e4eefb9bdfbe51ba96e'/>
<id>8021cb02de840d6168a98e4eefb9bdfbe51ba96e</id>
<content type='text'>
With this parameter set, sessions are learned after receiving upstream headers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this parameter set, sessions are learned after receiving upstream headers.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: added the "max-age" attribute to cookie.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2017-04-07T13:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=7acbe17776a4133a08c7b5f502dc4a8fc40b2aef'/>
<id>7acbe17776a4133a08c7b5f502dc4a8fc40b2aef</id>
<content type='text'>
RFC 6265 defines "Max-Age" cookie attribute in section 5.2.2.

If the "expires" option is passed to the "sticky" directive, "max-age"
attribute will appear in cookies set by the module with corresponding
value in seconds.

For the special "max" value of the "expires" option, corresponding "max-age"
attribute value will be set to 315360000 seconds (10 years, similar to
how its done in headers_filter module for the "Cache-Control" header).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RFC 6265 defines "Max-Age" cookie attribute in section 5.2.2.

If the "expires" option is passed to the "sticky" directive, "max-age"
attribute will appear in cookies set by the module with corresponding
value in seconds.

For the special "max" value of the "expires" option, corresponding "max-age"
attribute value will be set to 315360000 seconds (10 years, similar to
how its done in headers_filter module for the "Cache-Control" header).
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: added variables support to cookie domain.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2016-09-28T07:55:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=c988a6e2c13fc37cfc09d11a492540cd4e44163a'/>
<id>c988a6e2c13fc37cfc09d11a492540cd4e44163a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: added "httponly" and "secure" attributes.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2015-03-17T15:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=6c13f0468be05a4d9f2f36e1a28ebbe14ac10281'/>
<id>6c13f0468be05a4d9f2f36e1a28ebbe14ac10281</id>
<content type='text'>
The attributes are described in RFC6265, sections 4.1.2.5 and 4.1.2.6
respectively.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The attributes are described in RFC6265, sections 4.1.2.5 and 4.1.2.6
respectively.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sticky: added the "learn" mode.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2014-05-05T07:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=af7137c88a87d4592d8d5879adf50b151d61e5b6'/>
<id>af7137c88a87d4592d8d5879adf50b151d61e5b6</id>
<content type='text'>
In this mode, nginx "learns" which client uses which proxied server by
analyzing headers of client requests and proxied server responses.

For example, a proxied server may start sessions by issuing the "Set-Cookie"
header field to set cookie 'sid' and returning clients will bring the cookie
with the same name.

The following configuration may be used to handle this case:

upstream u1 {
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;

    sticky learn timeout=10m zone=sess:1m
           create=$upstream_cookie_sid
           lookup=$cookie_sid;
}

Co-authored-by: Ruslan Ermilov &lt;ru@nginx.com&gt;
Co-authored-by: Maxim Dounin &lt;mdounin@mdounin.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this mode, nginx "learns" which client uses which proxied server by
analyzing headers of client requests and proxied server responses.

For example, a proxied server may start sessions by issuing the "Set-Cookie"
header field to set cookie 'sid' and returning clients will bring the cookie
with the same name.

The following configuration may be used to handle this case:

upstream u1 {
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;

    sticky learn timeout=10m zone=sess:1m
           create=$upstream_cookie_sid
           lookup=$cookie_sid;
}

Co-authored-by: Ruslan Ermilov &lt;ru@nginx.com&gt;
Co-authored-by: Maxim Dounin &lt;mdounin@mdounin.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Upstream: added sticky sessions support for upstreams.</title>
<updated>2026-03-09T17:08:30+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2013-04-02T21:44:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=104734f21888cfec6994e092073f51a0d4b0fb47'/>
<id>104734f21888cfec6994e092073f51a0d4b0fb47</id>
<content type='text'>
Sticky sessions allow to route the same client to the same upstream server.

- upstream structures are extended to keep session-related information

- existing balancing modules are updated to provide an id of the selected
  server (SID) in pc-&gt;sid, and to select the server, given it's SID.

- other balancing modules are allowed to set the pc-&gt;hint value to choose
  the desired peer.  The sticky module will not change the hint if it's
  already set.

- the feature is enabled by default and can be disabled with the
  "--without-http_upstream_sticky" switch of the configure script.

The following configuration can be used to enable sticky sessions for
supported balancing modules:

    upstream u1 {
        server 127.0.0.1:8080;
        server 127.0.0.1:8081;

        sticky cookie server_id expires=1h domain=.example.com path=/;
    }

Co-authored-by: Ruslan Ermilov &lt;ru@nginx.com&gt;
Co-authored-by: Roman Arutyunyan &lt;arut@nginx.com&gt;
Co-authored-by: Maxim Dounin &lt;mdounin@mdounin.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sticky sessions allow to route the same client to the same upstream server.

- upstream structures are extended to keep session-related information

- existing balancing modules are updated to provide an id of the selected
  server (SID) in pc-&gt;sid, and to select the server, given it's SID.

- other balancing modules are allowed to set the pc-&gt;hint value to choose
  the desired peer.  The sticky module will not change the hint if it's
  already set.

- the feature is enabled by default and can be disabled with the
  "--without-http_upstream_sticky" switch of the configure script.

The following configuration can be used to enable sticky sessions for
supported balancing modules:

    upstream u1 {
        server 127.0.0.1:8080;
        server 127.0.0.1:8081;

        sticky cookie server_id expires=1h domain=.example.com path=/;
    }

Co-authored-by: Ruslan Ermilov &lt;ru@nginx.com&gt;
Co-authored-by: Roman Arutyunyan &lt;arut@nginx.com&gt;
Co-authored-by: Maxim Dounin &lt;mdounin@mdounin.ru&gt;
</pre>
</div>
</content>
</entry>
</feed>
