Friday, August 12, 2011

I Rule for F5 LTM

I- Rule is a power full  code which modify the http header and redirect the http request to any way you want.
One of the common use is to transfer a http request to https based connection for security or www.x.com to https://x.com. I am attaching the sample code for http transfers.

rule 1

rule redirect_HTTPS

when HTTP_REQUEST {
  if { [TCP::local_port] == 80 }{
    HTTP::redirect https://[getfield [HTTP::host] ":" 1][string tolower [HTTP::uri]]
  }
}

rule 2

when HTTP_REQUEST {
            if { [HTTP::host] contains "www.x.com"} {
            HTTP::redirect https://x.com[HTTP::uri] }
}



No comments:

Post a Comment

Palo Alto firewall handy troubleshooting CLI commands

 > show interface management Show management Interface details > show system info Display system’s management IP, Serial number, and c...