Forum Discussion

Jesse_Reinhart_'s avatar
Jesse_Reinhart_
Icon for Nimbostratus rankNimbostratus
Sep 08, 2017

Pass protocol via header using HTTP profile

Hi!

 

I'm trying to pass a header identifying what protocol was used to establish a connection from the Big-IP to the back end web server. We have a fairly high number of virts, so ideally we do this through an HTTP profile rather than an iRule.

 

I know that identifying the port correlates to the protocol, but due to other non-standard ports being used for specific circumstances I would like to be able to determine the protocol used rather than the port.

 

I see that there's an area in the HTTP profile to insert X-Forwarded-For - we use this and it works fine. I also see that there's an area covering XFF alternative names. I have tried using various names here (including X-Forwarded-For) but the headers aren't passed.

 

Is there a way I can tell the Big-IP to pass X-Forwarded-Proto through to the web server using an HTTP profile rather than an iRule?

 

Thanks!

 

2 Replies

  • Hello,

     

    Unfortunately you can`t insert X-Forwarded-Proto without an iRule.

     

    Regards

     

  • Hi,

     

    You can use this code

     

    when CLIENT_ACCEPTED {
        set ssl 0
    }
    
    when CLIENTSSL_CLIENTHELLO {
        set ssl 1
    }
    
    when HTTP_REQUEST {
        if {$ssl} {
            HTTP::insert X-FORWARDED-PROTO https
        }
    }