As we all are aware of, almost everybody does own a tablet (portable) device today. We are simply going mobile, and it is necessary to present information in tablet format for users accessing any envirenmont from those kind of devices. For this matter we are going to take advantage of the Responder Feature on Netscaler to make our users satisfied and happy.

Så Let’s put up a new scenario where we do host some Webservers behind a Netscaler loadbalancer. Those Web servers do host all kind of pages we are intending to return to users depending on the devices they are connecting from:
Note! We assume that we are not using any kind of responsiv pages…
1. Connecting from mobile devices, then return the following:
“companypage.index.mobile.html”
2. Connecting from any desktops like MAC or PCs, then return the following:
“companypage.index.html”

We are also going to have in mind that we are using an External Load Balancer (Netscaler).

So Let’s make reality of this and configure our Netscaler to handle those requests in a proper way and return the right page format depending on the devices our users are using. Let’s also suppose that you already load balanced your Webservers

This is what we need to accomplich this:

1. Two Responder Actions (1 for desktop- and an other for requests comming from mobile devices)
2. Two Responder Policies (1 for desktop- and an other for requests comming from mobile devices)
3. One Load Balancing Service Group where we load balance our WebServers
4. One Load Balancing Virtual Servers where the service Group is bound to
5. One Content Swithing Virtual Server (to use in case you would like to use the same IP for several Web instances. Our loadbalancer will be hide behind this vServer)

Ok, Let’s start configuring this by starting with creating a Load Balancing service Group to Load Balance our Webservers

1. Create a Load Balancing Service Group using the HTTP protocol or SSL if you have a certificate in Place, and add your Webservers using the same Weight parameter (1)

2. Create a Load Balancing Virtual Server HTTP (used in this scenario), or SSL if you have a certificate in Place, and bind the Service Group you already created to it.

3. Create a Content Switch Virtual Server HTTP (used in this scenario), or SSL if you have a certificate in Place (need to allocate an internal IP for this)

4. Create a Responder Action (Redirect Type) for the desktop pages and use the following expression:

“http://” + HTTP.REQ.HOSTNAME.HTTP_URL_SAFE + “/index.html”

5. Create a Responder Action (Redirect Type) for the mobile pages and use the following expression

“http://” + HTTP.REQ.HOSTNAME.HTTP_URL_SAFE + “/index.mobile.html”

6. Create a Responder policy for desktop pages and bind it to the desktop responder action from step 4 (Use The DROP action as Undefined-Result Action):

(HTTP.REQ.URL.PATH.EQ(“”) || HTTP.REQ.URL.PATH.EQ(“/”) || HTTP.REQ.URL.PATH.EQ(“/index.html”)) && HTTP.REQ.HOSTNAME.STARTSWITH(“companypage.index.html”)

7. Create a Responder policy for mobile pages and bind it to the mobile responder action from step 5 (Use The DROP action as Undefined-Result Action):

(HTTP.REQ.URL.PATH.EQ(“”) || HTTP.REQ.URL.PATH.EQ(“/”) || HTTP.REQ.URL.PATH.EQ(“/index.html”)) && HTTP.REQ.HOSTNAME.STARTSWITH(“companypage.index.mobile.html”) && (HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“iPad”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“iPhone”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“Android”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“BlackBerry”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“Windows Mobile”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“PlayBook”) || HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“Windows Phone”) && HTTP.REQ.HEADER(“User-Agent”).CONTAINS(“Touch”))

8. Bind both responder policies to the Load Balancing vServer where the reponder policy for mobile pages should have a higher priority.

9. Configure a Content Switching action and bind it to your load balancing vServer, and a content switching policy with an appropriate rule for your case and bind it to the action you just configured.

10. Now all web requests should hit the the content switching vServer, and the appropriate page should be returned to users.

You’re done 😉