jay_41157
Aug 28, 2008Nimbostratus
can this Irule be optimized?
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::uri]] starts_with $::legacyPaths] } {
checked for matchclass == legacyPaths and forward to Legacy_http_pool
snat 172.23.0.60
HTTP::header insert X-Forwarded-For [IP::remote_addr] this was done to test i am trying to do it using http profile..
used for debub
HTTP::redirect http://www.google.com
pool Legacy_http_pool
} else {
when uri matches admin in Literatum check for source ip
if { [HTTP::uri] starts_with "/admin" and (not [matchclass [IP::remote_addr] equals $::Admin]) } {
path for admin uri but not internal IP
log local0. "External IP ([IP::remote_addr]) attempting to access admin path ([HTTP::uri])"
HTTP::redirect http://redirect.com/404.html
} else {
pool Stage_http_pool
}
}
}
---------------Thanks
Also I am using a custom http profile for this, where I am using insert X-forward-for. When I try to check for X-forward-for in fiddler (ie) or live headers in firefox I do not see it there... should I ?
THanks