Forum Discussion
Rohan
Nimbostratus
Dec 20, 2019irule to redirect to to cloud WAF
We have below requirement and our url is hosted on cloud for WAF and waf access VIP on F5 using which url is not known and we have to stop access of www.abc.prod.co.in from intenet and we want when...
cjunior
Nacreous
Jan 28, 2020Hi,
I would just change [HTTP :: path] to [HTTP :: uri] to not lose querystring values when there and discard connections instead of reject.
Anyway, an LTM policy works fine in this case and I may prefer to use it.
Finally, my iRule code should be:
when HTTP_REQUEST {
set host [string tolower [getfield [HTTP::host] : 1]]
if { [class match [IP::client_addr] equals datagroup_abc] } {
pool Pool_abc
} elseif { $host eq "abc.co.in" ||
$host eq "www.abc.prod.co.uk" ||
$host eq "192.168.168.10" } {
HTTP::respond 301 -version auto noserver Location "http://www.abc.co.in[HTTP::uri]" Connection Close
} else {
discard
}
unset host
}Regards.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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