Netscaler content switching and rewrite - help!

0 votes
asked May 26, 2015 by henrikmc2 (150 points)
I have about 30 url rewrite / redirect rules to implement and need some help with overcoming an obstacle:

 

Example:

 

One content switch virtual server

6 lb vservers

30 cs policies

30 rewrite url policies and actions

 

My problem:

I have a url request "/pdf_test" which should be redirected to "/pdf" on <server1>

Then I also have to handle another request "/pdf" send to <server2>

It seems the way it works on NS is that cs policy first, then rewrite policy.

That means "/pdf" can only be directed once to a lb vserver, but I need pdf_test to hit <server1>

 

does that make sense?

1 Answer

+1 vote
answered Sep 16, 2016 by SuperZ82 (640 points)
selected Dec 3, 2016 by jmelika
 
Best answer
So if yo haven't already solved this, I'm thinking

Do you require LB on the services your providing? one URL to one server and the other URL to another server? Nope? Otherwise...

URL /pdf_test

Run the following commands from the command line interface:
add rewrite action rewrite_url_act replace HTTP.REQ.URL.PATH_AND_QUERY "\"/pdf""
add rewrite policy rewrite_url_pol "HTTP.REQ.HEADER(\"Host\").CONTAINS(\"www.yourdomain.com/pdf_test") "rewrite_url_act
bind lb vserver rewrite_LB -policyName rewrite_url_pol -priority 10 -gotoPriorityExpression END -type REQUEST

This should get around the CS issue and your just masking the pdf from the end client.
...