Forum Discussion
http redirect to another node and uri
Hi All,
We have recently a f5 LTM Appliance. Now I deal with iRules and have already a few simple deployed. But now I have problems to expand an iRule.
Here is my working iRule.
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "http://[HTTP::host]/abc" } }
Now I want to expand the iRule, that if a Client comes with IP w.x.y.z then redirect him to a node with another IP outside the pool and another URI. Can anyone please help me?
Best regards Jan
- Lee_Sutcliffe
Nacreous
Put the IP addresses that you want to send to a specific node in a datagroup (type string). Then use the following iRule to match on that condition to a specific node, otherwise redirect as normal.
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { if {[class match [IP::client_addr] equals "client_ip_dg"]} { [HTTP::uri] /xyz node 192.168.1.1:80 } else { HTTP::redirect "http://[HTTP::host]/abc" } } }
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