For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Therap_Ops_1222's avatar
Therap_Ops_1222
Icon for Nimbostratus rankNimbostratus
Jul 23, 2013

Add Server ID in Response Header

I've 4 app servers running behind the LTM. I was able to insert server's IP address and port number with the following iRule.

 

 

when HTTP_RESPONSE {

 

HTTP::header insert SERVER_ADDRESS "[IP::server_addr]:[TCP::server_port]"

 

}

 

 

But I don't want to pass my server's IP address and port number. Since LTM already identify the pool members so is there any way I can insert a server ID into the response header?

 

 

Thanks,

 

Shuvo

 

 

 

4 Replies

  • Where would the server ID come from? Is it an arbitrary value? If so you may want to consider a simple data group lookup method (ex. server IP := server ID).

     

  • Off the top of my head I don't believe an iRule has access to an assigned node "name". You could potentially do a reverse DNS lookup of the server to get its host name, but the simplest option given that you only have 4 app servers, is to create a string-based data group. Example:

    Data group "server_dg"

    10.10.10.1 := server1

    10.10.10.2 := server2

    10.10.10.3 := server3

    10.10.10.4 := server4

    And an iRule something like this:

    
    when HTTP_RESPONSE {
         HTTP::header insert SERVER_ADDRESS [class lookup [IP::server_addr] equals server_dg]
    }