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

Turn off pop notifications in chrome browser from major news outlets

 On Chrome browser, go to settings select privacy and security select site settings select Java Script Select Don't allow sites to use J...