Forum Discussion
irule to proxy traffic externally to another site
If all you're wanting to do is sending the request to another webserver, then you can achieve this with the node (or pool) commands, though you might need to rewrite the HTTP request to change the Host: line if the final webserver is not configured to respond to
I'm thinking something like this
when HTTP_REQUEST {
switch -- [HTTP::uri] { "/testurl1" { HTTP::header replace "Host" "othersite1.org" pool othersite1_pool }
"/testurl2" {
HTTP::header replace "Host" "othersite2.org"
pool othersite2_pool
}
}
log local0. "Sending [HTTP::uri] to [LB::server]\r\n\r\n"
}
The virtual server has a pool named "default_pool", which is where anything not sent elsewhere by the irule will end up.
If I request /something.txt, then I get the default_pool:
Rule /Common/irule-to-proxy-traffic-externally-to-another-site : Sending /something.txt to /Common/default_pool 0
And if I request /testurl1, it sends the request to a member of otherside1_pool:
Rule /Common/irule-to-proxy-traffic-externally-to-another-site : Sending /testurl1 to /Common/othersite1_pool 0
Does that help ?
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