Forum Discussion
Using an iRule for a proxy pac file
Thanks Dario. That was my own post which i did several years back. I forgot about this, I had searched for this and couldn't find. Thanks for sending me this.
Hello,
According to my understanding, could be this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "myhostname.society.com" && !( [HTTP::uri] contains "/pathA" || [HTTP::uri] contains "/pathB" || [HTTP::header Referer] contains "/pathA" || [HTTP::header Referer] contains "/pathB" ) } { HTTP::respond 403 } }
as well this one:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "myhostname.society.com" } { switch -glob [HTTP::path][HTTP::header Referer] { "*/pathA*" - "*/pathB*" { } default { HTTP::respond 403 } } } }
I hope it helps.
Nevermind, Actually this iRULE seems to be ok !!
I used only this one on my VS and everything looks fine ,
the condition switch -glob [HTTP::path][HTTP::header Referer] is perfect in my case !!
Thanks you cjunior !!
Here the solution worked on my case:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "hostname" } {
switch -glob [HTTP::path][HTTP::header Referer] {
"*/pathA*" -
"*/pathB*" { }
default { log local0. "condition header et hostname"
reject }
}
}
}