cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1521
Views
0
Helpful
5
Replies

Load Balance Reverse Poxy using ACE and HTTP Header Sticky

Dear all,

I have a reverse proxy that makes HTTP and HTTPS requests to an ACE.

For implement persistence I want to configure HTTP HEADER Stickyness using the X-Forwarder-For information but I don't know:

  • How to implement it ( I'l apreciate a little example about it).
  • Which values I need for OFFSET and LENGHT fields.

Can you help me please?

Thanks a lot!!

5 Replies 5

Cesar Roque
Level 4
Level 4

Hi David,

Here is a basic HTTP configuration inserting the x-forward-for:

serverfarm host sample
  rserver test1
    inservice
  rserver test2
    inservice


class-map match-any sample
  3 match virtual-address 170.173.175.65 tcp eq www


policy-map type loadbalance first-match test
  class class-default
    serverfarm sample
    insert-http x-forward header-value "%is"

policy-map multi-match int901
  class sample
    loadbalance vip inservice
    loadbalance policy test
    loadbalance vip icmp-reply active

---------------------
Cesar R
ANS Team

--------------------- Cesar R ANS Team

Hi Cesar.

Thanks a lot for your answer but I think you misunderstand the question or I'm not explaninig very well

I don't need to insert anything.

The serverfarm X will be accesed by a reverse proxy. This reverse proxy already inserts the X-Forearder-From header, so the request from the reverse proxy comes with this header to the serverfarm X.

The problem is that now, the serverfarm X sticky the client based on source IP. This is a wrong behavior becasue all the request comes form the same source (Reverse proxy) and all the load forwards to the same real IP address.

This is because I want to change the sticky from source IP to HTTP header and looks for the X-Forwarder-For filed.

Hop it will clarify the question!

Hi David,

Actually, this should be easy to do using stickiness based on cookies.  The sticky group should look like this:

sticky http-cookie [cookie-name] [sticky group name]

  cookie insert browser-expire

  serverfarm [serverfarm name]

---------------------
Cesar R
ANS Team

--------------------- Cesar R ANS Team

mruuth
Level 1
Level 1

Hi David,

here you have an exampel.

sticky http-header X-Forwarded-For SH-EXAMPEL

  header offset 0 length 15

  serverfarm SFPfarm

  timeout 60

  replicate sticky

 

  policy-map type loadbalance first-match VEXAMPEL-l7slb

  class class-default

    sticky-serverfarm SH-EXAMPEL

Regards

Mats

Dear.

I'm not sure what is the best solution for this case:

- Load Balance using HTTP Header.

- Load BAlance using cookie.

I'm sure that the reverse proxy insert the X-Forwarder-For but I don't know how cookie insertion works.

Thanks!!

Review Cisco Networking for a $25 gift card