Forum Discussion
Pat_Gorsuch_109
Oct 20, 2005Nimbostratus
HTTPS redirect on URI
Not huge into writing rules, but I had hoped I would be able to hack my way through a simple task. Obviously that notion has fallen on its butt.
I need to redirect requests containing a specific string within the URI to only one server; everything else can use any host in the pool. I think I have the syntax correct, though I can't seem to get the hang of when to use a Server Profile (if at all?) and which one will get things moving.
Specifics:
https://www.conhugeco.com/admin -> node 10.151.54.141
https://www.conhugeco.com/ -> conhugeco_web_pool
iRule:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/admin" } {
node 10.151.64.141
} else {
pool conhugeco_web_pool
}
}
I've set the Server Profile to HTTP (the VS is listening only on TCP/443). Nothing good happens. Actually, nothing happens. Even if I disable the iRule and leave everything else alone, there's no F5 love.
I realize that this may not have anything to do with the actual iRule, but I'm unsure how the Server Profile selection (and maybe other settings) effect the use of an iRule.
Any advice for a humble novice?
- Pat
- JRahmAdminTry a log statement before the if statement to see if you are getting the URI you are expecting
- Pat_Gorsuch_109NimbostratusThanks for the quick response.
- JRahmAdminis this a production unit? If not, make sure your iRule is associated to the virtual and try a bigstart restart tmm
- Pat_Gorsuch_109NimbostratusOh, you know it's in production.
- Pat_Gorsuch_109NimbostratusNothing like a kick in the butt to get me moving. Yes, I wasn't specifying my VS profiles properly. All happy now.
- Colin_Walker_12Historic F5 AccountAwesome to hear. I'm glad that things are working now.
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