Forum Discussion
Luca_55898
Jun 27, 2011Nimbostratus
Redirect to TCP port based on URL
Hello,
We have an Alteon load balancer that will be replaced with an LTM very soon.
We have a pool of two servers which run a bunch of different websites. The sites all use the s...
Peter_72728
Jun 27, 2011Nimbostratus
First, I noted that you were testing [HTTP::uri] for a match to "www.site1.com/test". Assuming that "www.site1.com" is the domain, that would never be true because [HTTP::uri] only contains the path and querystring parts of the URL. Take a look at the page below...It should help clarify the portions of a URL (i.e. HTTP::host, HTTP::uri, etc).
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/18/How-to-parse-a-URI.aspx
I think you could do something like the following...
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/employees*" { pool pool-81 }
"/customers*" { pool pool-82 }
"/new_users*" { pool pool-83 }
}
}
Obviously this assumes that you have created the pools (pool-81, pool-82, etc) that contain members listening on the appropriate port.
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