Forum Discussion

MC77's avatar
MC77
Icon for Nimbostratus rankNimbostratus
Apr 02, 2020

iRule to append http profile and persistence based on header

I have a VIP that I can't append a HTTP profile to, but need to check a host header and apply persistence to it. Is there an iRule that I can append to this VIP to assist? I'm running 12.1.1

1 Reply

  • Hello MC77.

     

    A Virtual Server interprets protocol stacks base on what profiles you assign to it.

     

    If you configure a Standard VS with only tcp profile, that means that only protocols until transport (TCP) stack are going to be parsed.

     

    If you include also a HTTP profile, that means that HTTP protocol will be also parsed (http methods, http uri, http headers,...).

     

    You cannot assign a http profile base on headers easyly, because the http headers are parsed only when you assign a http profile to the VS.

     

    One idea which comes to my mind is to use 'virtual' command inside of an iRule to redirect queries from one VS to another VS.

    This is call 'VIP-Tarjeting-VIP'.

    REF - https://clouddocs.f5.com/api/irules/virtual.html

     

    Maybe, clarifying what are your final goals we could give a different and easier approach. Why to modify http profile base on header?

     

    KR,

    Dario.