Jump to content
Welcome to our new Citrix community!

Content Switching expression


Recommended Posts

Hi Team,

 

Hope you all are doing great!

 

I have requirement where abc-initiatve.com traffic should go to 1 set of server and abc-initiative.com/lms traffic goes to 1 set of server.

 

Solution :- I am trying to achieve it by 1 CS VIP and 2 non-addressable LB VIP.

 

if above approach is correct then please help me with content switching expression which will help to direct the traffic to non-addressable LB VIP based on above requirement.

 

Regards,

Shekhars

Link to comment
Share on other sites

 

add cs vserver cs_vsrv_demo http <VIP1> 80

# these are your non addressable vservers; bind services or service groups as appropriate

add lb vserver lb_vsrv_set1 http

add lb vserver lb_vsrv_set2 http

 

# create the policies:  (There are multiple expressions that can do this; but additional information might be needed)

Expression 1:  http.req.header("host").set_text_mode(ignorecase).eq("abc-initiative.com") && http.req.url.path.get(1).set_text_mode(ignorecase).eq("lms")  

Alt expression 1 for lms:  http.req.header("host").set_text_mode(ignorecase).eq("abc-initiative.com") && http.req.url.path.set_text_mode(ignorecase).startswith("/lms")

 

Expression 2:  http.req.header("host").set_text_mode(ignorecase).eq("abc-initiative.com") && http.req.url.path.eq("/")

# now this might not be what you need depending on how dependent objects are handled; but this rule is broader than the first one so must be lower priority.

 

Build the cs policies in the GUI with the aprpropriate expressions.  Without actions, you'll bind the policy and set the target lb vserver for the lb destination. If you create the cs action with the lb vservers, and then include that in the cs policy, then when you bind the policy, omit the target lb vserver parameter.  Note: I didn't build the policies, just showing the binding.

 

bind cs vserver cs_vsrv_demo -policyName cs_pol_set1 -priority 100 -targetlbvserver lb_vsrv_set1

bind cs vserver cs_vsrv_demo -policyName cs_pol_set2 -priority 100 -targetlbvserver lb_vsrv_set2

 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...