Forum Discussion

Romain_Vergnio1's avatar
Romain_Vergnio1
Icon for Nimbostratus rankNimbostratus
Mar 31, 2006

How to remove the "Server: BIGIP" header when using "HTTP::redirect"

Hello all,

 

 

I use an iRule to redirect HTTP traffic to HTTPS and it works fine, here it is :

 

 

----------------------------------------------------------

 

when HTTP_REQUEST {

 

Redirects all to HTTPS keeps URI intact

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

----------------------------------------------------------

 

 

However I noticed that BigIP adds a "Server: BIG-IP" header in the response, is there a way to remove it ?

 

 

I tried all these examples without success :

 

 

----------------------------------------------------------

 

when HTTP_REQUEST {

 

Redirects all to HTTPS keeps URI intact

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

HTTP::header remove Server

 

}

 

-----------------------------------------------------------

 

 

or

 

 

-----------------------------------------------------------

 

when HTTP_REQUEST {

 

Redirects all to HTTPS keeps URI intact

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

 

when HTTP_RESPONSE {

 

HTTP::header remove Server

 

}

 

------------------------------------------------------------

 

 

or even (I know it's the same but it tried it anyway...) :

 

 

iRule n°1

 

------------------------------------------------------------

 

when HTTP_REQUEST {

 

Redirects all to HTTPS keeps URI intact

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

------------------------------------------------------------

 

iRule n°2

 

------------------------------------------------------------

 

when HTTP_RESPONSE {

 

HTTP::header remove Server

 

}

 

------------------------------------------------------------

 

 

It seems that "when HTTP_RESPONSE" matches only when receiving the response from the web server, not when the "redirect" function is used.

 

 

Anyone has an idea ?

 

Thanks a lot.

 

 

Regards,

 

Romain Vergniol

 

4 Replies

  • I thought you might be able to avoid the Server: BIG-IP header by using HTTP::respond, like so:

     

     

    when HTTP_REQUEST {

     

    HTTP::respond 302 Location "https://[HTTP::host][HTTP::uri]"

     

    }

     

     

    ...but I still see the Server: BIG-IP header in the response.

     

     

    I was thinking you might be able to reset the header in an HTTP profile, but that looks to only be applicable to requests being sent to a node.

     

     

    Aaron
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    You could try specifying the Server header in the HTTP::respond command. eg:
    when HTTP_REQUEST {
       HTTP::respond 302 Location "https://[HTTP::host][HTTP::uri]" Server blablabla
    }

  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    Try this rule out then ...

    
    when HTTP_REQUEST {
       set my_loc "http://www.i_want_a_bigip_for_christmas.com"
       TCP::respond "HTTP/1.1 302 Found\r\nLocation: $my_loc\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
       TCP::close
    }
  • As of 9.4.2 you can use HTTP::respond to achieve the same thing:

      when HTTP_REQUEST {
         HTTP::respond 302 noserver Location "https://[HTTP::host][HTTP::uri]" 
      }
    

    The noserver flag suppresses that header.