Forum Discussion
Insellj
Oct 17, 2023Altostratus
Set Header for Pool items and return it in the Virtual IP (VIP)
Hi, We have a Virtual IP (VIP) setup which load balances requests to a pool of servers. We need to be able to add in a response header depending on which pool server responds. This is so that we can...
- Oct 18, 2023
Found a solution 😁 CA_Valli PSFletchTheTek
when HTTP_RESPONSE { set xserveron_header_value [class match -value [IP::server_addr] equals webfarm_headers] if {$xserveron_header_value ne ""}{ HTTP::header insert X-Server-On $xserveron_header_value } }
CA_Valli
Oct 18, 2023MVP
Well you might as well collect this variable in the SERVER_CONNECTED event ..
If I get it right the purpose of your header will be identify the server in the farm during tshoot - IMHO having the IP address as the header value is a pretty good information for doing that .. so I think the iRule might be as easy as
when SERVER_CONNECTED {
set xserveron [IP::server_addr]
}
when HTTP_REQUEST_SEND {
clientside { HTTP::header insert "X-Server-On" "$xserveron" }
}
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