Forum Discussion

ryank5589's avatar
ryank5589
Icon for Nimbostratus rankNimbostratus
Feb 18, 2020

iRule assistance based on URI and source address

Hey all!   I have an application that currently allows for all users to connect to a java and non java version based on the URI that you browse to. I would like to allow only a specific range o...
  • NAG's avatar
    Feb 19, 2020

    Following iRule code should remove the redirect loop to the nonjava version.

     

    when HTTP_REQUEST { 
     
        if { ([HTTP::uri] contains "/java/version") && ([class match [IP::client_addr] equals JAVA-VERSION-NETS]) } {
     
            pool My-Web-Pool
     
        } else { 
        
                if { [HTTP::uri] contains "/java/version" } { 
                
                HTTP::redirect https://application.com/nonjava/version
                
                }
    			
    			pool My-Web-Pool
        }
    }