Forum Discussion
Rick_Deerberg_2
Nimbostratus
Jun 14, 2006How to write an iRule to redirect to multiple uri's and to specific TCP Port (81)
I am a newbie when it comes to load balancing and iRules.
I have a user who wants to the following configured.
Default or main page/site
https://default.domain.com/
Sit...
Deb_Allen_18
Jun 14, 2006Historic F5 Account
OK, how about this then:
when HTTP_REQUEST {
set myURI [string tolower [HTTP::uri]]
if { $myURI contains "site-a" } {
HTTP::uri /site-A[HTTP::uri]
pool site-A
} elseif { $myURI contains "site-b" } {
HTTP::uri /logon/logon.html
pool site-B
} else { pool Default_Pool }
}
The pool for site A would contain the appropriate list of port 80 servers, and requests for any URI /already/ containing the string "site-A" would now include that string twice:* URI sent by client: /site-A/somedir/somefile.txt
* URI sent to server: /site-A/site-A/somedir/somefile.txt
The pool for site B would contain the appropriate list of port 81 servers, and any requests for any URI containing "site-B" would be changed to request the login page:
* URI sent by client: /site-B/somedir/somefile.txt
* URI sent to server: /logon/logon.html
Defaul_Pool must also be defined to include the appropriate list of port 80 servers, and requests will be forwarded unmodified.
HTH
/deb
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