Forum Discussion
Therap_Ops_1222
Nimbostratus
Jul 23, 2013Add 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
- Kevin_Stewart
Employee
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). - Therap_Ops_1222
Nimbostratus
How would LTM ID'ed the pool members? By numbers or by IP address? - Therap_Ops_1222
Nimbostratus
Can I insert node1, node2 etc?
- Kevin_Stewart
Employee
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:when HTTP_RESPONSE { HTTP::header insert SERVER_ADDRESS [class lookup [IP::server_addr] equals server_dg] }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects