Forum Discussion

Sean_McGirk_859's avatar
Sean_McGirk_859
Icon for Nimbostratus rankNimbostratus
Apr 17, 2008

I Rule not working as expected

This was originally used on an old V4.x LTM. I updated the syntax for V9.x. This is a simple HTTP to HTTPS redirect but it is not working as I expected. Not only does it not redirect but it breaks the entire VIP.

 

 

when HTTP_REQUEST {

 

if { [TCP::server_port] == 80} {

 

HTTP::redirect "https://test.spheris.com"}

 

else {

 

discard

 

}

 

}

2 Replies

  • Is port 80 your real server's port? Either way, the error's might be in the placement of your curly brackets. Try this:

    
    when HTTP_REQUEST {
      if { [TCP::local_port] == 80 } {
        HTTP::redirect "https://test.spheris.com"
      } else { discard }
    }