Forum Discussion
nitass
Feb 10, 2013Employee
I 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