Forum Discussion

Aaron_Warner_11's avatar
Aaron_Warner_11
Icon for Nimbostratus rankNimbostratus
Nov 14, 2013

Exchange HTTP redirect method for multitenancy irule

Hi Guys Wonder if someone can help me make this more correct. The goal is to have a single external IP that receives http redirect request from autodiscover clients and then redirects them to the cor...
  • IheartF5_45022's avatar
    Nov 14, 2013

    I can't see anything wrong with the logic - here's a idea to move you forward with the Rule though and including some logging;-

    when HTTP_REQUEST {
    
    if { [class match [string tolower [HTTP::host]] equals dg_autoDiscover_tenants] && [HTTP::uri] equals "/autodiscover/autodiscover.xml"} {
        log local0. "Redirecting [HTTP::host][HTTP::uri] to [class match -value [string tolower [HTTP::host]] equals dg_autoDiscover_tenants]"
        HTTP::respond 302 Location [class match -value [string tolower [HTTP::host]] equals dg_autoDiscover_tenants] 
    return
    }  
    }
    

    So your datagroup dg_autoDiscover_tenants would have Hosts as keys, and URIs ie https://autodiscover.environment2.com/autodiscover/autodiscover.xml as values. Check for logging output in /var/log/ltm.