Forum Discussion
mikey_webb
Cirrus
Dec 14, 2020Custom response header to identify pool member - help
i would like to insert a response header for diags to identify which server handled the request I have the below as a start when HTTP_RESPONSE { HTTP::header insert SERVER_INFO "...
jaikumar_f5
Noctilucent
Dec 15, 2020On the same lines, , sometimes passing server details over header are considered sensitive information's. In that case you'd need to hash them before you insert it.
when HTTP_RESPONSE {
set hash [b64encode [md5 "[IP::server_addr]:[TCP::server_port]"]]
HTTP::header insert Server "$hash"
}
In case your server is 1.1.1.1:443, the header will have Server: 7NPef5jNbRYGxqSIJ/QBtQ== as hashed information.
To confirm, with below command you can get the hash value.
echo -n '1.1.1.1:443' | openssl dgst -md5 -binary | base64
Note, hashing is one-way function, so this can't be done reverse way to get the IP:443.
Use accordingly.
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