Forum Discussion
Help simple irule
Hello, need best way to contruct a simple irule but that will allow me to add uri paths as the become active, what i have now is...
Im already doing a basic https redirect
HTTPS VIP is 10.10.10.100 with pool Pod5Pool
So external users will come in from https://mypods.icomp.com/pod5 and be natted to the VIP and past the the pool member with the /pod5 intact.
Internal useres will hit the VIP with they may or may not type /pod5 but I need them to end up at the same pool member with /pod5 whether they typed it or not.
But I will be adding more pods, like pod6, pod7 all going to the same pool member just with a uri path
Thank you.
3 Replies
- Kevin_Stewart
Employee
Well, the easiest thing to do would be to just redirect the user (any user) to /pod5 if they didn't include it.when HTTP_REQUEST { if { not ( [string tolower [HTTP::uri]] starts_with "/pod5" ) } { HTTP::redirect "https://[HTTP::host]/pod5[HTTP::uri]" } }
That would work for /pod5, but not sure how you'd know which pod to send a user to in the absence of some trigger value. - Gill_32697
Nimbostratus
Got you, let me rephrase.. In the absence of a trigger, id sent them to a default home page, something like www.myhomepage.com So in your example I would need to add pod ? would I just copy and add a new line with pod6, pod7 . The user will add the pod via a link or shortcut, i just need to pass the pod to the pool memeber otherwise if no pod number then default-page.com
I will always send request to pool Pod5pool, I just want to pass the uri /pod to the pool memeber, if no /pad then default page.
So logically is would flow like this.
if url contains /pod5
Pod5pool member
if url contains /pod6
Pod5pool member
if url contains /pod7
Pod5pool member
othwerwise
default page - Kevin_Stewart
Employee
So something like this?when HTTP_REQUEST { if { not ( [string tolower [HTTP::uri]] starts_with "/pod" ) } { HTTP::uri "/default.html" } }
Assuming you've assigned the Pod5pool to the virtual server, this would (transparently) send any request URI that didn't start with "/pod" to default.html. In this case you also wouldn't have to edit the iRule when adding new pods.
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