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...
Andres_Villacis
Nimbostratus
Oct 07, 2011thanks, Hoolio.
The irule works fine when a default pool is selected in the GUI but when I add in the irule an pool selection the irule the aplication response but with errors in the content.
I am using V10.2.1 and the irule is:
bigip.conf:
class nombre {
{
host 192.168.2.10 { "www1one.example.com" }
host 192.168.2.20 { "www2one.example.com" }
host 192.168.2.30 { "www1two.example.com" }
host 192.168.2.40 { "www2two.example.com" }
host 192.168.2.50 { "www1one.test.com" }
host 192.168.2.60 { "www2one.test.com" }
}
}
irule:
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 nombre]
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."}
}
}
}
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