Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

directing traffic to specific server based on URL

I've got 2 servers in a server farm on round robin load balancing set up. Right now, it load balances requests to www.abc.com. I would like all requests for www.abc.com/admin to go to server A all the time. What's the best way of accomplishing this? I've tried setting up stickiness with no luck so I'm not sure if that's the right approach. Thanks.

2 REPLIES
Community Member

Re: directing traffic to specific server based on URL

First create class-map with your url:

class-map type http loadbalance match-any ABC
  3 match http url /admin.*

Next create new server-farm with only one server:

serverfarm host SERVERFARM.SERVER1
  rserver RSERVER.ONE 80
    probe PROBE.ONE
    inservice

Next modify your policy-map type load-balance:

policy-map type loadbalance first-match POLICY.LB
  class ABC
    serverfarm SERVERFARM.SERVER1
  class class-default
    sticky-serverfarm STICKY.SERVERFARM.ONE

Everything what is matched by Class-map will be forwarded to Serverfarm. Simple and very scalable.

Community Member

Re: directing traffic to specific server based on URL

Thank you! That worked for me.

211
Views
0
Helpful
2
Replies
CreatePlease to create content