Forum Discussion
irule help for uri redirection
Hello Need some help on building an irule, very new to irules.
http://soft.abc.com/expo - would redirect the request to Expo server on a certain port (say 2000) http://soft.abc.com/granite - would redirect the request to Granite server on a certain port (say 4000) http://soft.abc.com/csg - would redirect the request to CSG server on a certain port (say 5000)
I understand the basic that I shall add node to a pool with certain port as a member and then use Http uri method in irule for redirection.
Thanks!
3 Replies
- amalhotra_6478
Nimbostratus
Here is what I build up and looking how to combine and if any correction to it Appreciate help if someone can look into it Thanks!
when HTTP_REQUEST { if { [HTTP::uri] contains "/expo" } { pool expo_pool port 2000 } else { pool all_pool } }
when HTTP_REQUEST { if { [HTTP::uri] contains "/granite" } { pool granite_pool port 4000 } else { pool all_pool } }
- amalhotra_6478
Nimbostratus
This is second one I build so far Please advise if any corrections or better options on it.
when HTTP_REQUEST {
if {[HTTP::uri] contains "/expo" } { pool granite_pool port 2000 }
if {[HTTP::uri] contains "/granite" } { pool granite_pool port 4000 }
if {[HTTP::uri] contains "/csg" } { pool csg_pool port 5000 }
}
- amalhotra_6478
Nimbostratus
Checked some irules on Dev Centeral seems port will be required with Node, if I mention Pool port is not required as pool will be configured with a member listening on port. I think this shall work, will be great if someone has done a similar request earlier. Getting familiar with irules little bit.
when HTTP_REQUEST { if { [HTTP::uri] contains "/expo" } { pool pool_expo }
if { [HTTP::uri] contains "/granite" } { pool pool_granite }
if { [HTTP::uri] contains "/csg" } { pool pool_csg
} else { pool default_pool }
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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