Forum Discussion

N__197982's avatar
N__197982
Icon for Nimbostratus rankNimbostratus
Sep 14, 2017

looking for help to tweak iRule

Folks, We have an iRule which looks at the HTTP request and does some work based on that request.

 

Here is the extract: if { [HTTP::host] contains "domainname.com"}

 

and then do this do that. I want to add one more clause in the same statement saying if HTTP::host contains domainname.com and the requests is on SSL.

 

How can I do that?

 

Thanks, N.

 

2 Replies

  • use one of the followings:

    First:
    if { [HTTP::host] contains "domainname.com" && [SSL::mode] == 0 }
    

    Second:

    if { [HTTP::host] contains "domainname.com" && [TCP::local_port] == 443 }
    
  • Hi,

     

    the question is WHY?

     

    when you configure a virtual server with an irule, you may know if the server is SSL or not.

     

    I tried the SSL::mode command and it don't work if CLIENTSSL or SERVERSSL profiles are not assigned to the VS.