Forum Discussion
irule for custom header
Hi Puluck,
... if you need to insert the X-Origin-Port header into the request send to your backend application use the code below...
when HTTP_REQUEST_SEND {
clientside {
HTTP::header replace "X-Origin-Port" [TCP::remote_port]
}
}
... if you need to insert the X-Origin-Port header into the responses send to your clients you may use this code...
when HTTP_RESPONSE {
HTTP::header replace "X-Origin-Port" [TCP::remote_port]
}
Note: I've changed the header name to "X-Origin-Port" and placed the Port into the header value section. This makes much more sense for me. Well, if the header name must be "X-Origin-Port-80/81" then use HTTP::header replace "X-Origin-Port-[TCP::remote_port]" "1", since a HTTP header MUST always have a value to become fully RFC compliant.
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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