Forum Discussion
Bob_10976
Nimbostratus
Jul 12, 2010iRule to use specific server based on URL/URI request
Hello all..
When the request for https://hostdomain.com/project is requested I need to go direct and only one of the nodes in the assoicated pool. I can't have any other request go to this ...
hoolio
Cirrostratus
Jul 13, 2010If you create two separate pools, you can create two corresponding HTTP classes. The first class would check for paths (URIs) matching /project* and have the /project pool assigned. The second HTTP class would have no filters and have the VS's default pool assigned. The project HTTP class would look like this in the bigip.conf:
profile httpclass project_httpclass {
defaults from httpclass
pool project_http_pool
redirect none
paths "/project*"
}
Or if you don't like the idea of using HTTP classes for this pool selection logic, you could create a new project pool named project_http_pool and use an iRule like this to select between the VS default pool and the project pool:
when CLIENT_ACCEPTED {
Save the name of the VS default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check the requested path with wildcard matching
switch -glob [HTTP::path] {
"/project*" {
/project URI
pool project_http_pool
}
default {
non-/project URI
pool $default_pool
}
}
}
Aaron
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