Forum Discussion

harton's avatar
harton
Icon for Nimbostratus rankNimbostratus
Aug 22, 2011

Common URI

I have a situation where I have a common portal for various customers. Customer A uses www.xyz.com/customerA and customer B uses www.xyz.com/customerB etc. The LTM directs the customers to their own app servers (customer A to pool A, customer B to pool B). There is a new feature that will be implemented, but the problem is that it's a common URI. When customer A clicks on the new feature, the application server replies back with a generic URI as www.xyz.com/nf. The exact same URI is given to customer B. The code can't be changed to make it www.xyz.com/customerA/nf. Is there a way for the LTM to send the data back to the correct pool when the URI has changed to a common one as above?

 

 

 

  • Hi Harton,

    How about setting a cookie if a request comes to a URI starting with /customerA or /customerB indicating which customer the user is and then referencing that in subsequent requests which aren't to a customerA or customerB URI?

    when HTTP_REQUEST {
    
        Check if this is a customerA or customerB request
       switch -glob [HTTP::path] {
          "/customerA*" {
             set cust "customerA"
             pool customerA_pool
          }
          "/customerB*" {
             set cust "customerB"
             pool customerB_pool
          }
          default {
              Check if there is a cookie indicating which customer this is
     switch [HTTP::cookie customer] {
        "customerA" {
           pool customerA_pool
        }
        "customerB" {
           pool customerB_pool
        }
        default {
            Specify a default pool name to use here
           pool default_pool
    
            Unset the customer variable
           if {[info exists cust]}{ unset cust }
        }
     }
          }
       }
    }
    when HTTP_RESPONSE {
    
        Set a cookie if we know which customer this is
       if {[info exists cust]}{
          switch $cust {
     "customerA" {
        HTTP::cookie insert customer name "customerA" path "/"
     }
     "customerB" {
        HTTP::cookie insert customer name "customerB" path "/"
     }
          }
       }
    }
    

    Aaron
  • harton's avatar
    harton
    Icon for Nimbostratus rankNimbostratus
    Hi Aaron,

     

     

    Thanks a bunch!!! I'll give this a try.

     

     

     

    Harton