MEDIUM: stick-tables: Add srvkey option to stick-table
This allows using the address of the server rather than the name of the
server for keeping track of servers in a backend for stickiness.
The peers code was also extended to support feeding the dictionary using
this key instead of the name.
Fixes #814
diff --git a/doc/configuration.txt b/doc/configuration.txt
index be8cb9e..e5e8546 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -10647,7 +10647,7 @@
stick-table type {ip | integer | string [len <length>] | binary [len <length>]}
- size <size> [expire <expire>] [nopurge] [peers <peersect>]
+ size <size> [expire <expire>] [nopurge] [peers <peersect>] [srvkey <srvkey>]
[store <data_type>]*
Configure the stickiness table for the current section
May be used in sections : defaults | frontend | listen | backend
@@ -10724,6 +10724,16 @@
be removed once full. Be sure not to use the "nopurge" parameter
if not expiration delay is specified.
+ <srvkey> specifies how each server is identified for the purposes of the
+ stick table. The valid values are "name" and "addr". If "name" is
+ given, then <name> argument for the server (may be generated by
+ a template). If "addr" is given, then the server is identified
+ by its current network address, including the port. "addr" is
+ especially useful if you are using service discovery to generate
+ the addresses for servers with peered stick-tables and want
+ to consistently use the same host across peers for a stickiness
+ token.
+
<data_type> is used to store additional information in the stick-table. This
may be used by ACLs in order to control various criteria related
to the activity of the client matching the stick-table. For each