From: Willy Tarreau Date: Wed, 30 Sep 2026 12:28:07 +0000 (+0200) Subject: DOC: config: mention that url_ip and url_port fail when passed a name X-Git-Tag: v3.5-dev8~75 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=0d157919df45b888a50dccb41ef23952a3734da0;p=haproxy.git DOC: config: mention that url_ip and url_port fail when passed a name url_ip and url_port both rely on a call to url2sa() which tries to parse digits in the authority part. This means that neither is usable with a host name. For example www.example.org:443 will not return an IP address nor even port 443 since the IP address parsing fails early. It's worth being said since it's not obvious. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 0122ea301..a873678d2 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -28682,7 +28682,8 @@ url32+src : binary url_ip : ip This extracts the IP address from the request's URL when the host part is - presented as an IP address. Its use is very limited. For instance, a + presented as an IP address. The fetch fails when the host part is a name, + as no resolution is performed. Its use is very limited. For instance, a monitoring system might use this field as an alternative for the source IP in order to test what path a given source address would follow, or to force an entry in a table for a given source address. It may be used in combination @@ -28690,7 +28691,9 @@ url_ip : ip url_port : integer This extracts the port part from the request's URL. Note that if the port is - not specified in the request, port 80 is assumed.. + not specified in the request, port 80 is assumed. As for "url_ip", this only + works when the authority of the URL is presented as an address, the fetch + fails when it is a host name since no resolution is performed here. urlp([[,[,i]]]) : string url_param([[,[,i]]]) : string