doesn't it already work? what http header do you refer? it is http host header, isn't it?
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool foo list
pool foo {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b pool http_pool list
pool http_pool {
members 172.28.19.251:80 {}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
HTTP::collect [HTTP::header Content-Length]
HTTP::header replace Host "newhost"
}
when HTTP_REQUEST_DATA {
set hsl [HSL::open -proto TCP -pool http_pool]
set request_cmd "HTTP::request"
log local0. "[IP::client_addr]:[TCP::client_port]: Collected [HTTP::payload length] bytes"
HSL::send $hsl "[eval $request_cmd][HTTP::payload]"
}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.20.11(40283) <-> 172.28.19.79(80)
1354200884.1507 (0.0031) C>S
---------------------------------------------------------------
POST /something HTTP/1.1
User-Agent: curl/7.19.7 (i686-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8x zlib/1.2.3 libidn/0.6.5
Accept: */*
Host: test.com
Content-Length: 14
Content-Type: application/x-www-form-urlencoded
postdata123456---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(40283) <-> 200.200.200.101(80)
1354200884.1526 (0.0016) C>S
---------------------------------------------------------------
POST /something HTTP/1.1
User-Agent: curl/7.19.7 (i686-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8x zlib/1.2.3 libidn/0.6.5
Accept: */*
Host: newhost
Content-Length: 14
Content-Type: application/x-www-form-urlencoded
postdata123456---------------------------------------------------------------
New TCP connection 3: 172.28.19.80(58616) <-> 172.28.19.251(80)
1354200884.1536 (0.0010) C>S
---------------------------------------------------------------
POST /something HTTP/1.1
User-Agent: curl/7.19.7 (i686-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8x zlib/1.2.3 libidn/0.6.5
Accept: */*
Host: newhost
Content-Length: 14
Content-Type: application/x-www-form-urlencoded
postdata123456---------------------------------------------------------------