Forum Discussion
Chris_Phillips
Nimbostratus
Feb 08, 2013httpclass vs irule uri priorities
Howdy,
I've a rule which is blocking or permitting access to certain URI's by means of a starts_with match. I can match "/testuri" against the request uri, e.g. /testuri/example and then ...
nitass
Employee
Feb 09, 2013I was trying to set up my rule so that I would block / (i.e. every url by default) and then allow /testuri as a specfiic location underneath that. This again works fine, however the logic clashes with the redirect from / to /home.doesn't it work? did i miss something?
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
httpclass myhttpclass
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b profile myhttpclass list
profile httpclass myhttpclass {
defaults from httpclass
pool none
redirect "http://[HTTP::host]/home"
paths "/"
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/testuri*" { }
default {
reject
}
}
}
}
[root@ve10:Active] config curl -I http://172.28.19.252
HTTP/1.0 302 Found
Location: http://172.28.19.252/home
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.252/home
curl: (52) Empty reply from server
[root@ve10:Active] config curl -I http://172.28.19.252/testuri/index.html
HTTP/1.1 200 OK
Date: Sun, 10 Feb 2013 07:43:28 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 10 Feb 2013 07:30:55 GMT
ETag: "46801b-59-c5d949c0"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8
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