Forum Discussion
irule for custom header
Hello All,
I have requirement ,where F5 need to insert custom header before load balance the traffic .Client will connect on http port ,but traffic will be sent to port 81 on backend pool for one VIP and for another VIP client connect on http port and traffic will be send to http port on backend pool .
Cusomter header will be X-Origin-Port-80 or X-Origin-Port-81
Thanks
1 Reply
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