Send custom header to server, not client.

Would this iRule,

when HTTP_REQUEST { HTTP::header insert “MyHeaderName” “MyHeaderValue” }

when applied to a virtual server, send the “MyHeaderName/MyHeaderValue” header to the back-end web servers?

If not, how can I trigger a header to be created and sent to the back-end web servers with each client request?

Hi,

You should be able to invoke this with HTTP_REQUEST_RELEASE

https://devcentral.f5.com/wiki/iRules.HTTP-REQUEST-RELEASE.ashx

Cheers Josh

So was HTTP_REQUEST { HTTP::header insert “MyHeaderName” “MyHeaderValue” } actually sending “MyHeaderName/MyHeaderValue” to the client with each request? The opposite of what I wanted to do?

Hi Josh,

Your syntax looks fine and does exactly what you’ve asked for. The HTTP_REQUEST (my prefered event), HTTP_REQUEST_SEND or HTTP_REQUEST_RELEASE events are almost interchargeable in your specific case…

Cheers, Kai