Forum Discussion
JCMATTOS_41723
Nimbostratus
Dec 10, 2009HTTPS IP redirect?
We are using 9.4.7 and trying to create an irule that passess certain IP's thru w/o a redirect and redirects everyone else. I like to use one using a class/datagroup for easier IP entry, but I can't seem to get it to work properly. Any ideas?
when HTTP_REQUEST {
switch [matches[IP::client_addr] eq $::NETgroup] {
forward
}
{HTTP::redirect "https://[HTTP::host][HTTP::uri]"}
}
- The_Bhattman
Nimbostratus
Hi JC,when HTTP_REQUEST { if { [matchclass [IP::client_addr] equals $::myIPs] } { forward } else { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- JCMATTOS_41723
Nimbostratus
Strange...I pasted it in and matched up the datgroup names. Now if your part of the IP class you get an error, but everyone else gets redirected as expected. - The_Bhattman
Nimbostratus
Here is some changeswhen HTTP_REQUEST { if { [matchclass [IP::client_addr] equals $::NETgroup] } { forward } else { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- JCMATTOS_41723
Nimbostratus
Strange...I changed the forward to an actual pool and it works? I do have a pool configured as the default. Why wouldn't forward work? - The_Bhattman
Nimbostratus
Hi JC - JCMATTOS_41723
Nimbostratus
I just saw that article. Is there a way to use the default pool without having to add it statically? - The_Bhattman
Nimbostratus
Hi JC,when HTTP_REQUEST { if { ![matchclass [IP::client_addr] equals $::NETgroup] } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
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