Forum Discussion

Gill_32697's avatar
Gill_32697
Icon for Nimbostratus rankNimbostratus
Dec 03, 2013

https redirect except not for this client ip.

Another irule help please. I have this basic https redirect on a vip, it currently applies a redirect to all vip traffic. I need to modify so if a specific client IP comes in, there is no redirect applied, it should allow it thru on http. So in other words, if client is 55.66.77.88 process with http everyone else gets https redirect.

 

when HTTP_REQUEST { HTTP::redirect https://[HTTP::host][HTTP::uri] }

 

  • Correct the ! == not so if should read if the client ip not euqal 55.66.77.88 then do this. With out the ! it would only redirect on the IP match.

     

  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account

    The following should give you a idea on what to do.

     

    when HTTP_REQUEST { if { ! [IP::addr [IP::client_addr] equals 55.66.77.88] } { HTTP::redirect "HTTPS://[HTTP::host][HTTP::uri]" } }

     

  • I think its in reverse. Im looking for everyone to have https applied and redirected. Unless, if you are ip 55.66.77.88 then you don't get https redirect, you are allows to continue to the url/uri using http.

     

    when HTTP_REQUEST { if { ! [IP::addr [IP::client_addr] equals 55.66.77.88] } { HTTP::redirect "HTTPS://[HTTP::host][HTTP::uri] } }

     

  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account

    Correct the ! == not so if should read if the client ip not euqal 55.66.77.88 then do this. With out the ! it would only redirect on the IP match.