Forum Discussion
Rewriting URI for load balancing domino servers
I load balance two pools of domino servers, one for users in Mail1 and one for users in Mail2. First request to the virtual server (mail.domain.com for exmaple) can go to any of the domino servers for authentication, and after authentication, domino server redirects (after we modified the redirect in the domino server) user to mail.domain.com/Mailx/mail/username.nsf?OpenDatabase. An irule looks for /Mail1 or /Mail2 in the URI in order to send to the appropriate server. However once the pool decision is made, I need to remove the /Mail1 or /Mail2 before sending to the domino server. Is there a slick way to do that? The examples I have seen append to HTTP::URI to create a new URI, I want to subtract.....
6 Replies
- nathe
Cirrocumulus
Mark,
Try the "string range" command in an irule.
Something like "HTTP::uri [string range [HTTP::uri] x end]"
Here's an excellent iRules 101 write up of strings for more details:
https://devcentral.f5.com/articles/-the101-irules-101-string-handling-and-manipulation
Should be enough "string range" examples on DC to get you what you want.
Hope this helps, N
Hi Mark,
I agree that Nathan's suggestion of using string range will work, but will require you to count the characters that you want to remove.
If you are looking for something easier I would suggest "string map". Something like this:
"HTTP::uri [string map {"/mail1" "" "/mail2" ""} [HTTP::uri]]"
You've got lots of options :-)
- nathe
Cirrocumulus
Thanks Michael - the daft thing is I use string map in one of my irules at work!!! More haste, less speed in responding I think.
- Michael_Yates
Nimbostratus
Hi Mark,
I agree that Nathan's suggestion of using string range will work, but will require you to count the characters that you want to remove.
If you are looking for something easier I would suggest "string map". Something like this:
"HTTP::uri [string map {"/mail1" "" "/mail2" ""} [HTTP::uri]]"
You've got lots of options :-)
- nathe
Cirrocumulus
Thanks Michael - the daft thing is I use string map in one of my irules at work!!! More haste, less speed in responding I think.
- Mark_Cloutier
Nimbostratus
Thanks, I'll check it out, do some testing and post my results.
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