Forum Discussion
Robert_47833
Aug 07, 2011Altostratus
HTTP::header replace Host and HTTP:redirect
Hi,dear irule
1:if there are rule1 and rule2 under one VS,order is rule1 and rule2
rule1:
when HTTP:request {
if { [HTTP::host] euqals "www.srwd18.com"} {
HTTP::redirect "h...
nitass
Aug 07, 2011Employee
[root@tulip:Active] config b virtual bar list
virtual bar {
destination 172.28.17.66:http
ip protocol tcp
rules rule1
profiles
http
tcp
}
[root@tulip:Active] config b rule rule1 list
rule rule1 {
when HTTP_REQUEST {
log local0.info "rule1"
if {[HTTP::host] equals "www.srwd18.com"} {
snat automap
node 220.181.111.147 80
HTTP::header replace Host "www.baidu.com"
}
}
}
[root@tulip:Active] config curl -IL http://www.srwd18.com/
HTTP/1.1 200 OK
Date: Sun, 07 Aug 2011 16:31:46 GMT
Server: BWS/1.0
Content-Length: 7410
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sun, 07 Aug 2011 16:31:46 GMT
Set-Cookie: BAIDUID=63CB57D21D237F0DF3EB449022233FC0:FG=1; expires=Sun, 07-Aug-41 16:31:46 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
New TCP connection 8: 172.28.17.60(33128) <-> 172.28.17.66(80)
1312733826.7271 (0.0001) C>S
---------------------------------------------------------------
HEAD / HTTP/1.1
User-Agent: curl/7.15.3 (i686-redhat-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7l zlib/1.1.4
Host: www.srwd18.com
Accept: */*
New TCP connection 9: 172.28.17.60(33128) <-> 220.181.111.147(80)
1312733826.7283 (0.0011) C>S
---------------------------------------------------------------
HEAD / HTTP/1.1
User-Agent: curl/7.15.3 (i686-redhat-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7l zlib/1.1.4
Host: www.baidu.com
Accept: */*
---------------------------------------------------------------
1312733827.0685 (0.3401) S>C
---------------------------------------------------------------
HTTP/1.1 200 OK
Date: Sun, 07 Aug 2011 16:31:46 GMT
Server: BWS/1.0
Content-Length: 7410
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sun, 07 Aug 2011 16:31:46 GMT
Set-Cookie: BAIDUID=63CB57D21D237F0DF3EB449022233FC0:FG=1; expires=Sun, 07-Aug-41 16:31:46 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects