Forum Discussion
Laurent_53635
Nimbostratus
Mar 08, 2010webmail Rewriting irule
Hello,
I am sure this question has already been asked many times but i do not manage to find the solution in this forum.
I have a VS on my LTM 9.4.5 in https. I want to implement the following behavior
https://site.test.com/IMsurvey/ => http://site1.test.corp/IMsurvey/
https://site.test.com/webmail/ => https://site2.test.corp/
Currently, my Irule is only able to implement that rewriting irule:
https://external.test.com/IMsurvey/ => http://server1.test.corp/IMsurvey/
https://external.test.com/exchange/ => https://server2.test.corp/exchange/
https://external.test.com/exchweb/ => https://server2.test.corp/exchweb/
...
For information, the server 2 is in fact a pool of 2 OWA 2003 and server 1 is a basic web server.
Here my irule:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/IMsurvey" } {
SSL::disable serverside
pool pool-IMsurvey
}
else {
if { [HTTP::uri] starts_with "/webmail" } {
log local0. "WEBMAIL BEFORE [HTTP::uri]"
HTTP::uri "/"
log local0. "WEBMAIL AFTER [HTTP::uri]"
}
SSL::enable serverside
pool pool_OWA
}
}
Please, could you give me reference to a simple example i can follow to fix this irule ?
Thanks a lot.
Laurent
- hoolio
Cirrostratus
Hi Laurent,when HTTP_REQUEST { Check the requested URI switch -glob [string tolower [HTTP::path]] { "/imsurvey/*" { Path started with /imsurvey/ so disable SSL and select the IMsurvey pool SSL::disable serverside pool pool-IMsurvey Exit this event in this rule return } "/webmail" { Path was exactly /webmail so rewrite the path to / HTTP::path "/" } } If we're still in the iRule, enable server SSL and select the pool SSL::enable serverside pool pool_OWA }
- Laurent_53635
Nimbostratus
Thanks fro you feedback - L4L7_53191
Nimbostratus
Note that you can set the value of HTTP::uri to whatever you want - it can present some fairly tricky situations but it can be done. You may want to look at the proxypass iRule for this as well, which takes a bunch of the edge cases into consideration and fixes them. - hoolio
Cirrostratus
hi Laurent,
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