Hi,
On Thu, Jul 04, Peter Hudec wrote:
> I have maybe found some bug in haproxy, submitted as
> https://github.com/haproxy/haproxy/issues/154.
1.8.4 is fairly old, can you reproduce on more recent 1.8.x or latest 2.0.x ?
> The variables dst, dst_port are identical with the src, src_port.
>
> Is there any other way how to get these /in this case dst/ values ??
>
> What do I need is ..
>
> http-request set-header X-Server-IP %[dst]
> http-request set-header X-Server-Port %[dst_port]
> http-request set-header X-Client-IP %[src]
> http-request set-header X-Client-Port %[src_port]
>
> result is ;(
>
> 'HTTP_X_CLIENT_PORT' => '22696',
> 'HTTP_X_CLIENT_IP' => '217.73.20.190',
> 'HTTP_X_SERVER_PORT' => '22696',
> 'HTTP_X_SERVER_IP' => '217.73.20.190’,
With this simple test config dst, dst_port etc. seem to work for me, does
this config work for you ?
global
stats socket /tmp/stats level admin
defaults
mode http
log global
option httplog
frontend test
bind :8080
default_backend test_be
backend test_be
http-request set-header X-Server-IP %[dst]
http-request set-header X-Server-Port %[dst_port]
http-request set-header X-Client-IP %[src]
http-request set-header X-Client-Port %[src_port]
server srv1 127.0.0.1:9000 id 1
listen yeah
bind [email protected]:9000
http-request deny deny_status 200
run with for example haproxy -d -f tmp.conf and
curl http://127.0.0.1:8080 and you should see the headers from haproxy debug
output.
-Jarno
--
Jarno Huuskonen