Forum Discussion
Nick_125548
Sep 11, 2013Nimbostratus
rewrite uri with datagroup
Hi
I'm new to irules and have got where I am but looking at other irules we have, but am still struggling.
I have a request from marketing to host a number (40) of small websites. Rather than se...
Lee_Payne_53457
Sep 11, 2013Cirrostratus
We do something similar although we don't rewrite the URL, what we do is look up the incoming URL then redirect to a pool but leave the URL alone, our code is:
when HTTP_REQUEST {
Get the requested host header
set req [HTTP::host]
get the actual pool based on the header
set redir [class lookup [HTTP::host] datagroup_name]
check if we have already LB them but looking for our cookie
log the redirect for troubleshooting (enable/disable as needed)
log local0. "Redirecting request for [HTTP::host] to $redir"
direct them to the pool as normal
pool $redir
eval [LB::select]
persist cookie
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects