DOC: configuration: do-resolve doesn't work with a port in the string
Fix the documentation about do-resolve to handle the case where a port
is associated to the hostname in the Host header.
Must be backported as far as 2.0.
(cherry picked from commit 1ef2460934bffb86bd32dcdc1d418946cfc809f5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e9e99f00af6e1f4b22452dff1a02256f919b619d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 714ce4cc52b78f19ae2fb7a27a1b18783f78ce7e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/doc/configuration.txt b/doc/configuration.txt
index 5d4c052..4b76f93 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -6162,7 +6162,8 @@
based on information found in the request (IE a Host header).
If this action is used to find the server's IP address (using the
"set-dst" action), then the server IP address in the backend must be set
- to 0.0.0.0.
+ to 0.0.0.0. The do-resolve action takes an host-only parameter, any port must
+ be removed from the string.
Example:
resolvers mydns
@@ -6177,7 +6178,7 @@
frontend fe
bind 10.42.0.1:80
- http-request do-resolve(txn.myip,mydns,ipv4) hdr(Host),lower
+ http-request do-resolve(txn.myip,mydns,ipv4) hdr(Host),lower,regsub(:[0-9]*$,)
http-request capture var(txn.myip) len 40
# return 503 when the variable is not set,