Forum Discussion
Manoj_Chavali
Jul 01, 2020Nimbostratus
F5 Redirect HTTP traffic to different ports based on context root
Hello folks, We have an application built on microservices i.e. each component within the application is hosted on the same machine but different tomcat instances i.e. different ports (8080, 8081...
Samir
Jul 02, 2020MVP
This can be achieve via iRule or F5 Policy.
Create the Pool based on the port wise and route the traffic on URI pattern. .
Example: Pool_8081 [ Member : 21.12.3.8:8081],
Pool_8082[ Member : 21.12.3.8:8082]
And route the traffic based on pattern. This is an example you can modify based on requirements
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
switch -glob $uri {
"/example1/*" {
pool Pool_8081
"/example2/*" {
pool Pool_8082
}
}
}
Cheers..
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