Forum Discussion
nitass
Jan 12, 2018Employee
I just need to redirect / rewwrite requests that come in to F5-VIP-Jenkins/info to jenkins-server:9000/jenkins_info. while still persisting any additional path that is supplied. So F5-VIP-Jenkins/info/project1 would redirect to jenkins-server:9000/jenkins_info/project1.
just another example
e.g.
// config
root@(ve13a)(cfg-sync In Sync)(Active)(/Common)(tmos) 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
}
translate-address enabled
translate-port enabled
vs-index 17
}
root@(ve13a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:9000 {
address 200.200.200.101
}
}
}
root@(ve13a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST_RELEASE {
if { [HTTP::uri] starts_with "/info/" } {
HTTP::host "[LB::server addr]:[LB::server port]"
HTTP::uri [string map {"/info/" "/jenkins_info/"} [HTTP::uri]]
}
}
}
// test
[root@ve13a:Active:In Sync] config ssldump -Aed -nni 0.0 port 80 or port 9000
New TCP connection 1: 172.28.24.1(42574) <-> 172.28.24.10(80)
1515777465.5177 (0.0006) C>S
---------------------------------------------------------------
GET /info/project1/helloworld HTTP/1.1
User-Agent: curl/7.29.0
Host: 172.28.24.10
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(3889) <-> 200.200.200.101(9000)
1515777465.5189 (0.0011) C>S
---------------------------------------------------------------
GET /jenkins_info/project1/helloworld HTTP/1.1
User-Agent: curl/7.29.0
Host: 200.200.200.101:9000
Accept: */*
---------------------------------------------------------------