Forum Discussion
Duncan_Morgan_1
Nimbostratus
Sep 17, 2005L7 redirect to pool based on requested folder
Hello All,
I would like to be able direct requests in a certain path to a specific pool. For example would like
http://mydomain.com/folder_name/ OR
https://mhydomain.com/folde...
Sep 17, 2005
DM,
The full url is broken out as follows:http://mydomain.com/folder_name
[HTTP::host] => mydomain.com
[HTTP::uri] => /folder_name
So you could use the HTTP::uri with a simple string comparison to do what you want.
For example:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/folder_name" } {
pool target_pool_name
}
}
This will take any incoming request where the uri starts the string "/folder_name" and forward it to "target_pool_name". Replace that to what your pool name is and you'll be in business.
The only thing that I don't quite understand from your post is this:In this case anything going to http://mydomain.com is already a working virtual server.
Does this mean you don't have a virtual server setup for the HTTPS requests? If not, then there is no magical way in an iRule to configure a virtual to listen for 443 requests without creating one for that purpose then you could assign this iRule to that virtual.
-Joe
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