Author Topic: ver 7.0 - How to perform content switching on load balanced vserver  (Read 3217 times)

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
I had my netscalers setup with Load Balanced Virtual Servers pointing to my IIS web server farm.  It was nice and simple.  After some time I realized that I needed to perform forwarding of http://mydomain.com to http://www.mydomain.com.  My options were:

1. Rewrite - this is a function of NS 7.0 and up.  I couldn't use this as it would mess up my cookies big time.
2. Do the redirection on each IIS server; except that it'd be a nightmare to maintain with the number of sites we have.  Not to mention how many servers I have to do this on.
3. Kill my Load Balance VServer and recreate it as a Content Switched VServer.  I couldn't do this either for the downtime it'd incur.

After tinkering for a little bit, I was able to do it this way.

1. From the GUI, go to Protection Features/Filter then go to the Actions tab
2. Add an action with Qualifier "ErrorCode", Response Codes "200", Response Page as follows:
       <meta http-equiv="refresh" content="0;url=http://www.mydomain.com/">
3. Give it a meaningful name (I use domainname_redirect) and create it.
4. Go to the Policies tab and Add a policy with Request Action pointing to the action you created, and add the following expression
        REQ.HTTP.HEADER Host == mydomain.com
5. Finally, go to Load Balancing/Virtual Servers, then open the Properties window of the Virtual Server you have and go to the Policies tab.  From there you can activate the newly created policy by putting a check mark in the box next to it.

You're all set!

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
This method was tested successfully with IE7 and Firefox.  It failed to work on Safari.  If you were able to get it to work with Safari or tested it with any other browser, please reply to this post.

Thanks!
JM

magnoolie

  • Guest
I wanted to let you know that I tried this method in Safari on Windows - yes it's released now:) - and it failed.

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
In order to make this to work in Safari, you just have to enclose the action code I listed in <html> and </html>.  It should look like this:
Code: [Select]
<html>
    <meta http-equiv="refresh" content="0;url=http://www.mydomain.com/">
</html>