Forum Discussion

siru_129409's avatar
siru_129409
Icon for Nimbostratus rankNimbostratus
Nov 27, 2015

iRule help

Hi Can anyone help me to create an iRule. My scenario is as following , Users from outside (internet) will access the url https://mail.company.com/archive for accessing their archived/old emails. but url on the archive server side is https://mycompany.archivemail.com/archive.

Mail.company.com is belongs to exchange 2013 server and the exchange service are load balanced and secured by BIG-IP LTM, APM and ASM. and the mycompany.archivemail.com is belongs to a different server, and this URL is not publicly accessible (It’s using for accessing the old/archived emails only).

In order to achieve the same, I have created a pool with name archive-pool for the archive servers and the following iRule for changing the user requested url.

when HTTP_REQUEST {

    if {[HTTP::uri] contains "/archive"}
         { 
         HTTP::header replace Host "mycompany.archivemail.com"
         Pool archive-pool
         }
         }

And the iRule is applied to the Exchange VS and placed on the top of Exchange_2013_apm_combined_pool_irule7 (which is created by iAPP)) But its not working, I am getting the page not found error, If anyone can help to resolve this issue it would be highly appreciated.

3 Replies

  • eneR's avatar
    eneR
    Icon for Cirrostratus rankCirrostratus

    I would do it this way:

    when HTTP_REQUEST {
    if {[string tolower [HTTP::uri]] starts_with "/archive"} {
        HTTP::header replace "Host" "mycompany.archivemail.com"
        pool archive-pool
        }
    }
    
  • Hi This is not working for me, After applying this irule I could see my browser is redirecting to my.company.archivemail.com and getting a error message of server not found.

     

  • eneR's avatar
    eneR
    Icon for Cirrostratus rankCirrostratus

    Well, for me the iRule looks fine but maybe any other one see's the fault..

    Personally i would write an

    log local0. "iRule xyz - Host:  [HTTP::host][HTTP::uri] sent to [LB::server addr]"

    into the irule and check the logs if everything looks like expected.

    But i believe that the LB process as it self has nothing to do with the URL/URI. So if the irule gets executed and the if statement is true, the request gets forwarded to the configured pool.

    Maybe there is something wrong with your pool-/member configuration?