Forum Discussion

Ganesh_Ramamoor's avatar
Ganesh_Ramamoor
Icon for Nimbostratus rankNimbostratus
Jan 25, 2006

persistence on HTTP non-standard header

 

Hello!

 

 

Is it possible to have persistence based on a non-standard HTTP header? I can't use "starts_with" or "contains" because I won't know what this header value could be. But if header "HEADER1" has the value "userxyz@domain123.com", then for all the subsequent requests with that same value for HEADER1 I would like the requests to go to the same servers as before.

 

 

Thanks

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    This is certainly something that's possible via iRules.

    It would look something like:

    
    when HTTP_REQUEST {
      if { [HTTP::header exists header1] } {
        persist uie [HTTP::header header1]
      }
      pool http_pool
    }

    This would set the persistence record to use the value from the header1 header if it exists, regadless of client IP information or anything else. Otherwise, it would just send the request along to the pool as a normal, non persistent request.

    HTH,

    -Colin
  •  

    Thanks!

     

    I tried that but it doesn't work for me. But now I think I know why, but I want to confirm this: I have two virtual servers, one with an external address and one with an internal address. Though both the virtual servers have the same iRule (with the persistence logic) assigned to them, I guess the persistence will be restricted to a virtual server? Meaning, there would be individual persistence tables for each virtual server, right?

     

    If that's the case, is there a way to do this? My requirement basically is as follows: Client comes in with header1 thru' external-virtual-server and goes to server1. Client then contacts server2 thru' external-virtual-server. Now server2 uses header1 and needs to contact server1 thru' internal-virtual-server (this is where the persistence is used to contact the same server1)

     

     

    Thanks

     

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    Try adding the persist universal profile to the virtual servers and enable the "across virtuals" option.