Forum Discussion
Steven_87308
Feb 10, 2012Nimbostratus
stuck on first complex irule - req for help
I'm writing to ask for help with the design of an irule solution. My goal is to get various URIs to either redirect to SSL during authentication, or to fail pass http through to a standard pool.
...
nitass
Feb 11, 2012Employee
for data group, i understand string value must be unique.
this is an example.
root@ve1110(Active)(/Common)(tmos) list ltm data-group internal redirectPathDataGroup
ltm data-group internal redirectPathDataGroup {
records {
/path1 { }
/path2 { }
}
type string
}
root@ve1110(Active)(/Common)(tmos) list ltm data-group internal poolPathDataGroup
ltm data-group internal poolPathDataGroup {
records {
/path3 {
data pool1
}
/path4 {
data pool1
}
}
type string
}
root@ve1110(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
set uri [HTTP::uri]
if {[class match -- [string tolower $uri] starts_with redirectPathDataGroup]} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} elseif {[class match -- [string tolower $uri] starts_with poolPathDataGroup]} {
pool [class match -value [string tolower $uri] starts_with poolPathDataGroup]
} else {
pool pool2
}
}
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port] | $uri | [IP::remote_addr]:[TCP::remote_port]"
}
}
[root@ve1110:Active] config curl -I http://172.28.19.252/path1/whatever?a=1
HTTP/1.0 302 Found
Location: https://172.28.19.252/path1/whatever?a=1
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1110:Active] config curl -I http://172.28.19.252/path2/whatever?a=1
HTTP/1.0 302 Found
Location: https://172.28.19.252/path2/whatever?a=1
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1110:Active] config curl -I http://172.28.19.252/path3/whatever?a=1
HTTP/1.1 404 Not Found
Date: Sat, 11 Feb 2012 02:58:59 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
[root@ve1110:Active] config curl -I http://172.28.19.252/path4/whatever?a=1
HTTP/1.1 404 Not Found
Date: Sat, 11 Feb 2012 02:59:02 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
[root@ve1110:Active] config curl -I http://172.28.19.252/whatever?a=1
HTTP/1.1 404 Not Found
Date: Sat, 11 Feb 2012 02:54:30 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
[root@ve1110:Active] config cat /var/log/ltm
Feb 10 18:50:24 tmm info tmm[7321]: Rule /Common/myrule : 172.28.19.253:34440 | /path3/whatever?a=1 | 200.200.200.101:80
Feb 10 18:50:26 tmm info tmm[7321]: Rule /Common/myrule : 172.28.19.253:34442 | /path4/whatever?a=1 | 200.200.200.101:80
Feb 10 18:50:30 tmm info tmm[7321]: Rule /Common/myrule : 172.28.19.253:34443 | /whatever?a=1 | 200.200.200.102:80
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