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/folder_name/
to a specific pool.
In this case anything going to
http://mydomain.com is already a working virtual server.
Is this possible?
Tx,
DM
3 Replies
- 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 - Duncan_Morgan_1
Nimbostratus
Joe,
thanks for you answer.
Further clarification here...
I have 2 virtual servers set up for the same domain - 1 is http and the other https (via client SSL)
http://mydomain.com:80
https://mydomain.com:443
Will this iRule work for both the http and https virtual servers?
Tx,
DM - unRuleY_95363Historic F5 AccountClick here for a posting that discusses the same issue.
http://devcentral.f5.com/Default.aspx?tabid=28&forumid=5&postid=4236&view=topic
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