Forum Discussion
Matthew_Hutchin
Nimbostratus
Jan 22, 2007Apache Virtual Hosts and Load balancing
I currently have a customer that is switching from an Apache Proxy server with Apache Virtual Hosts to and F5 BigIP LTM. I would like to know if anyone has eve done this and/or if it is possible to u...
nitass
Employee
Oct 08, 2011it seems working fine to me. what was the error?
[root@iris:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.17.33:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@iris:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "www.example.com" and [HTTP::uri] starts_with "/one" } {
pool Pool_Example_One
} elseif { [HTTP::host] equals "www.example.com" and [HTTP::uri] starts_with "/two" } {
pool Pool_Example_Two
} elseif { [HTTP::host] equals "www.test.com" and [HTTP::uri] starts_with "/one" } {
pool Pool_Test_One
}
}
when HTTP_REQUEST_SEND {
set host_debug 1
clientside {
if {$host_debug} {log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]"}
set host_header_value [class match -value [LB::server addr] equals nombr]
if {$host_debug} {log local0. "[IP::client_addr]:[TCP::client_port]: Looked up [LB::server addr], found: $host_header_value."}
if {$host_header_value ne ""} {
HTTP::header replace Host $host_header_value
if {$host_debug} {log local0. "[IP::client_addr]:[TCP::client_port]: Replaced Host header with $host_header_value."}
}
}
}
}
[root@iris:Active] config b class nombr list
class nombr {
{
host 10.10.70.201 { "www1one.example.com" }
host 10.10.70.202 { "www1two.example.com" }
host 10.10.70.211 { "www1one.test.com" }
}
}
1) www.example.com/one
New TCP connection 1: 172.28.16.50(37170) <-> 172.28.17.33(80)
1318066155.9017 (0.0171) C>S
---------------------------------------------------------------
GET /one HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www.example.com
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 10.10.72.30(37170) <-> 10.10.70.201(80)
1318066155.9021 (0.0003) C>S
---------------------------------------------------------------
GET /one HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www1one.example.com
Accept: */*
---------------------------------------------------------------
2) www.example.com/two
New TCP connection 1: 172.28.16.50(37200) <-> 172.28.17.33(80)
1318066205.3706 (0.0005) C>S
---------------------------------------------------------------
GET /two HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www.example.com
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 10.10.72.30(37200) <-> 10.10.70.202(80)
1318066205.3711 (0.0003) C>S
---------------------------------------------------------------
GET /two HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www1two.example.com
Accept: */*
---------------------------------------------------------------
3) www.test.com/one
New TCP connection 1: 172.28.16.50(37217) <-> 172.28.17.33(80)
1318066233.1738 (0.0005) C>S
---------------------------------------------------------------
GET /one HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www.test.com
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 10.10.72.30(37217) <-> 10.10.70.211(80)
1318066233.1743 (0.0002) C>S
---------------------------------------------------------------
GET /one HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www1one.test.com
Accept: */*
---------------------------------------------------------------
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