Forum Discussion
natewood70
Nimbostratus
Mar 11, 2015Load Balance Friendly URL to two unfriendly URL's
Hey Everyone,
Still being new to the F5 (It was pretty much thrown in my lap) some basic configuration items still go over my head.
I was wondering if it would be possible to create an iRul...
nitass
Employee
Mar 12, 2015e.g.
configuration
[root@ve11c:Active:In Sync] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 12
}
[root@ve11c:Active:In Sync] config tmsh list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
200.200.200.111:80 {
address 200.200.200.111
}
}
}
[root@ve11c:Active:In Sync] config tmsh list ltm data-group internal node2name
ltm data-group internal node2name {
records {
200.200.200.101 {
data myunfriendlyurl1.com
}
200.200.200.111 {
data myunfriendlyurl2.com
}
}
type string
}
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST_SEND {
if { [class match -- [LB::server addr] equals node2name] } {
clientside {
HTTP::header replace Host [class match -value [LB::server addr] equals node2name]
}
}
}
}
1st trace
[root@ve11c:Active:In Sync] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.24.1(52504) <-> 172.28.24.10(80)
1426159661.7394 (0.0008) C>S
---------------------------------------------------------------
HEAD / 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
Accept: */*
Host: myfriendlyurl.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(52504) <-> 200.200.200.111(80)
1426159661.7433 (0.0037) C>S
---------------------------------------------------------------
HEAD / 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
Accept: */*
Host: myunfriendlyurl2.com
---------------------------------------------------------------
2nd trace
[root@ve11c:Active:In Sync] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.24.1(52506) <-> 172.28.24.10(80)
1426159691.3216 (0.0017) C>S
---------------------------------------------------------------
HEAD / 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
Accept: */*
Host: myfriendlyurl.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(52506) <-> 200.200.200.101(80)
1426159691.3496 (0.0279) C>S
---------------------------------------------------------------
HEAD / 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
Accept: */*
Host: myunfriendlyurl1.com
---------------------------------------------------------------
please be noted that this irule does rewrite host header in request only. it does nothing on response.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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