Forum Discussion
jdalyasc_295749
Nimbostratus
Sep 15, 2017iRule for directing a uri to a port
I am fairly new to iRules so forgive me if this is a simple or dumb question.
Is it possible to configure an irule such that a HTTP request to a web URL can be identified by the information follow...
Faruk_AYDIN
Altostratus
Sep 16, 2017Hi Guy,
if you want to only redirect the users use that :when HTTP_REQUEST {
switch -glog [string tolower [HTTP::uri]] {
"/part1"
{
HTTP::redirect "http://website.com:80/part1"
}
"/part2"
{
HTTP::redirect "http://website.com:81/part2"
}
"/part3"
{
HTTP::redirect "http://website.com:82/part3"
}
}
}
But, in my opinion, you are using different ports on your servers for different applications, and you don't want your users to know those ports and to write on their browser address bars. If so, use this irule :
when HTTP_REQUEST {
let's say your server ip is 10.10.10.10
set server "10.10.10.10"
switch -glog [string tolower [HTTP::uri]] {
"/part1"
{
node $server 80
}
"/part2"
{
node $server 81
}
"/part3"
{
node $server 82
}
}
}
Hope it helps
Please mark it as answer if it is fine for you.
Best wishes
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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