MINOR: backend: add a new "path-only" option to "balance uri"
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2020 06:56:29 +0000 (08:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2020 06:56:29 +0000 (08:56 +0200)
commit57a374131cd3c1c46f9d78ea9c0f2ad027d0be97
tree406a5e369d699b565d45f7fbbd55c5e8a18cdbe1
parent3d1119d2257692f1508dd42f32c1840de0e16173
MINOR: backend: add a new "path-only" option to "balance uri"

Since we've fixed the way URIs are handled in 2.1, some users have started
to experience inconsistencies in "balance uri" between requests received
over H1 and the same ones received over H2. This is caused by the fact
that H1 rarely uses absolute URIs while H2 always uses them. Similar
issues were reported already around replace-uri etc, leading to "pathq"
recently being introduced, so this isn't new.

Here what this patch does is add a new option to "balance uri" to indicate
that the hashing should only start at the path and not cover the authority.
This makes H1 relative URIs and H2 absolute URI hashes equally again.

Some extra options could be added to normalize URIs by always hashing the
authority (or host) in front of them, which would make sure that both
absolute and relative requests provide the same hash. This is left for
later if needed.
doc/configuration.txt
src/backend.c