Forum Discussion
Local traffic policy question...
Let's clarify between "forward" and "redirect". Forward will proxy the traffic to the backend pool selected under the forward action. Redirect will respond to the client where the client will initiate a new connection to whatever URL is specified in the redirect action.
To put that in context, it sounds like the 5 different URI's (can all be under the same condition) forward their traffic to a backend pool, and the default should redirect to the external site. Try using those actions to achieve the desired result.
ExampleThe example below shows the configuration file for such a policy. This can be replicated from the XUI. The rules are where you define per rule a condition indicating what to look for (whether the URI's are in the packet) and an action (what to do if the condition is true). The ordinal simply says the order to process the rules (highest first).
One other caveat is the forward will typically give you the list of pools to select, whereas the redirect requires a Fully-Qualified Domain Name and URI (http[s]://mydomain/path). It will take that exact value and reply with a HTTP redirect using that as the location.
ltm policy devcentral-joe {
controls { forwarding }
requires { http }
rules {
internal-sites {
conditions {
0 {
http-uri
path
starts-with
values {
/test1
/test2
/test3
/test4
/test5
}
}
}
actions {
0 {
forward
select
pool my_backend_pool
}
}
ordinal 1
}
default {
actions {
0 {
http-reply
redirect
location http://otherpage.com/uri-to-redirect
}
}
ordinal 2
}
}
strategy first-match
}
Second question:
If you are performing a redirect (see first Q/A) then the client initiates the new connection, and your current instance loses administrative control over the session. There are means to proxy, but the best way to do so with LTM requires the static IP address of the external site--doing so with DNS is more of a function of GTM. I won't say it can't be done with LTM--you just may have to get creative to do so.
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