Ace url

Unanswered Question
Apr 23rd, 2012

Hi,

I have two servers to be balanced on port 80, but I received a request, from the team that makes the maintenance of these servers, to when anyone introduce a specific url, the access is always made through the same server.

This can be done? I have to use the match http url, or is it better to use the match http header?

thanks

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 5 (1 ratings)
Borys Berlog Mon, 04/23/2012 - 10:10

Hi

It depends on what exactly they mean.

I mean - do they ask if URL = http://XXXX.com that traffic always need to go to server #1

or they ask if URL = http://XXXX.com - traffic can go to any server first but then must sticky to this server.

With first case I'd say the best way is just to create separate serverfarm, place there this server #1 and then use match http url class in level 7 policy map (assuming that host part is the same and resolved to the same VIP)

In second case - different options are available and it's better to clarify, but generally - it can be the same + some kind of stickiness.

Borys Berlog Mon, 04/23/2012 - 10:39

In this case your first idea about url matching is absolutely correct.

L7 class map

class-map type http loadbalance L7-C

match http url /123

than you have serverfarm S1 which contains both of your servers and serverfarm S2 with contains only server #1

then in L7 policy map :

policy-map type load fir L7-p

class L7-C

serverfarm S2

class class-default

serverfarm S1

And than use it for necessary VIP

One note regarding URL matching (from my experience it's  quite often confusing

)

E.g. you have url in your browser like: http:/myweb.com/test/test.php

however when browser opens a connection - this URL can't be seen anywhere, it will be used like this :

-IP address of myweb.com will be determined and used in L3 header

- in L7, http header this part myweb.com will be used in header field "Host"

- this part /test/test.php will be placed in GET request , like GET /test/test.php HTTP1.1 (e.g.)

So, url matching in ACE actually matches  part which is in GET field , so you can't put there something like http://myweb.com/test/test.php, as host part is never in GET field. And actually URL as we see it in browser is never sent.

DPlagueHT Sun, 04/29/2012 - 02:59

anything of this kind:

serverfarm host Serverfarm_HTTP
  probe KPalive_HTTP
  rserver Server1
    inservice
  rserver Server2
    inservice

serverfarm host Serverfarm_URL
  probe KPalive_HTTP
  rserver Server1
    inservice

sticky ip-netmask 255.255.255.255 address source Sticky_HTTP
  timeout 30
  replicate sticky
  serverfarm Serverfarm_HTTP

class-map match-all CLA4_HTTP
  2 match virtual-address 172.16.15.10 tcp eq www

class-map type http loadbalance Cla7_URL
  2 match http url /123

policy-map type loadbalance first-match POL7_HTTP
  class Cla7_URL 
    serverfarm Serverfarm_URL 
  class class-default
    serverfarm Serverfarm_Portal

policy-map multi-match POL4_HTTP
  class CLA4_HTTP
    loadbalance vip inservice
    loadbalance policy POL7_HTTP
    loadbalance vip icmp-reply active

interface vlan 15
  description Frontend
  ip address 172.16.15.2 255.255.255.0
  alias 172.16.15.1 255.255.255.0
  peer ip address 172.16.15.3 255.255.255.0
  no icmp-guard
  access-group input ACL_PermitAll
  access-group output ACL_PermitAll
  service-policy input POL4_HTTP

thanks for the help

Actions

Login or Register to take actions

This Discussion

Posted April 23, 2012 at 8:00 AM
Stats:
Replies:5 Avg. Rating:5
Views:950 Votes:0
Shares:0

Related Content

Discussions Leaderboard

Rank Username Points
1 1,551
2 369
3 333
4 228
5 212
Rank Username Points
5