Cisco CSM URL Redirect
by admin on Jul.21, 2006, under Networking, load balancing
Here is a nice little config extra for your Cisco Content Switch Module or CSM. Basically what this will give you is whatever partial URL you put in the match statement, when sent to your vserver will be redirected to whatever URL you put in the webhost relocation statement. In the match statement do not put the full http://domain.com/etc…. because it will not work. If you just put in everything after the domain then your DNS will point that traffic to your vserver anyways. Questions about this just comment on this post.
policy TEST
url-map TEST
serverfarm TEST_REDIRECT
serverfarm TEST_redirect
nat server
no nat client
redirect-vserver TEST-RD
webhost relocation http://domain.com/redirected.html
inservice
vserver TEST-VS
virtual X.X.X.X tcp www
serverfarm TEST-SF
persistent rebalance
slb-policy TEST
inservice
map TEST url
match protocol http url “*original.html*”
July 3rd, 2007 on 3:31 pm
Assuming that the vserver for http and https is working and the real servers respond accordingly, how would I redirect all traffic destined for “http://www.mysite.com” to “https://www.mysite.com/things/stuff.html”??
I have tried several variations of your example and can not seem to make it work. Since your documentation is more intuative than Cisco’s, I figured I would ask you first.
July 5th, 2007 on 6:57 am
If you want to do the whole site say for a backup if your webservers fail use the following:
vserver MYSITE
virtual 1.1.1.1 tcp www
serverfarm MYSITE-SF backup FAILOVER
persistent rebalance
inservice
serverfarm FAILOVER
nat server
no nat client
redirect-vserver FL-OVER
webhost relocation https://www.mysite.com/things/stuff.html
inservice
If you want all traffic to always redirect make the FAILOVER serverfarm the main one under your vserver instead of the backup. Names I came up with don’t matter except to remember that the redirect-vserver name has to be different than the serverfarm it is in.
If all traffic is being redirected anyway you might what to setup a redirect on your webserver through IIS instead of in the CSM. Hope this helps, if you have more questions comment.