mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-22 04:10:48 +00:00
eb421b2fe0
Add a sample fetch for the name of a bind. This can be useful to take decisions when PROXY protocol is used and we can't rely on dst, such as the sample config below. defaults mode http listen bar bind 127.0.0.1:1111 server s1 127.0.1.1:1234 send-proxy listen foo bind 127.0.1.1:1234 name foo accept-proxy http-request return status 200 hdr dst %[dst] if { dst 127.0.1.1 }
23 lines
407 B
Plaintext
23 lines
407 B
Plaintext
varnishtest "so_name sample fetche Test"
|
|
|
|
#REQUIRE_VERSION=2.2
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
haproxy h1 -conf {
|
|
defaults
|
|
mode http
|
|
|
|
frontend fe
|
|
bind "fd@${fe}" name foo
|
|
http-request return status 200 hdr so-name %[so_name]
|
|
|
|
} -start
|
|
|
|
client c1 -connect ${h1_fe_sock} {
|
|
txreq -url "/"
|
|
rxresp
|
|
expect resp.status == 200
|
|
expect resp.http.so-name == "foo"
|
|
} -run
|