Forum Discussion
sundogbrew
Altocumulus
Apr 21, 2014redirect based on port
I have an application that already has a URL and needs to migrate to the F5. The way it is setup you go to the URL and get one application and if you go to the URL:port you get a second application....
nitass
Employee
Apr 22, 2014e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:0
ip-protocol tcp
mask 255.255.255.255
profiles {
clientssl {
context clientside
}
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 16
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when CLIENT_ACCEPTED {
switch [TCP::local_port] {
443 {
pool first_pool
}
8080 {
pool second_pool
}
default {
do something
}
}
}
when HTTP_REQUEST {
set url "https://[HTTP::host][HTTP::uri]"
}
when SERVER_CONNECTED {
log local0. "client=[IP::client_addr]:[TCP::client_port] vs=[clientside {IP::local_addr}]:[clientside {TCP::local_port}] url=$url pool=[LB::server pool] server=[IP::server_addr]:[TCP::server_port]"
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool first_pool
ltm pool first_pool {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool second_pool
ltm pool second_pool {
members {
200.200.200.111:80 {
address 200.200.200.111
}
}
}
/var/log/ltm
[root@ve11a:Active:In Sync] iproute2 tail -f /var/log/ltm
Apr 21 22:45:05 ve11a info tmm[13593]: Rule /Common/qux : client=172.28.24.1:60607 vs=172.28.24.10:443 url=https://newapp.com/something pool=/Common/first_pool server=200.200.200.101:80
Apr 21 22:45:20 ve11a info tmm[13593]: Rule /Common/qux : client=172.28.24.1:56450 vs=172.28.24.10:8080 url=https://newapp.com:8080/something pool=/Common/second_pool server=200.200.200.111:80
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